0

I have 3 columns with divs, the middle one has fixed size 977px, Left and Right one have no width, Im trying to set them automatic to have size equal to max window size - middle div size (977px) and devided by 2. So the left and right one are the same size. Is there any way to do that.

3
  • You could make 2 container div, with max size, and inner div's make on %. Commented Aug 23, 2013 at 11:05
  • Since you tagged "CSS3", will you be satisfied with flexbox? Commented Aug 23, 2013 at 11:18
  • As far as I know, it's not possible without the calc() function introduced in CSS3. like width:calc(100% - 400px); Commented Aug 23, 2013 at 11:23

2 Answers 2

1

Are u looking like this ?

HTML

<div id="container">
    <div id="left"></div>
    <div id="mid"></div>
    <div id="right"></div>
</div> 

CSS

body {
    margin: 0;
    padding: 0;
}

#container {
    width: 100%;
}

#mid {
    width: 977px;
    margin: 0 auto;
    background-color: red;    
    height: 100px;
}

TEST

Sign up to request clarification or add additional context in comments.

Comments

0

You can use the same class style for them and set a common size for them if you want

like this:

<div id="container>
    <div id="left" class="outerdivs"></div>
    <div id="mid"></div>
    <div id="right" class="outerdivs"></div>
</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.