Answer the question
In order to leave comments, you need to log in
Fully rubber layout in DIV (there are 2 solutions)
Is there any possibility, without using scripts, to do this:
[Rubber DIV, stretches from the content][Rubber div that takes up all the remaining space]
More: You need to make one of the blocks take up as much space as it needs to display all of your inline and block elements (Are there none? ok, width 0). And the other block stretched to the full width of the remaining space.
<div style="width:200px;float:left;">Первый див</div>
<div style="margin-left:200px;width:100%;">Второй див</div>
<div style="float:left;">Первый див</div><div>Второй див</div>
<div style="display:table;">
<div style="display:table-cell;">Первый див</div><div style="display:table-cell;">Второй див</div>
</div>
<div id="All">
<div id="div1">One</div>
<div id="div2"> Two</div>
</div>
*{
padding:0px;
margin:0px;
}
#All{
font-size: 2em;
width:100%;
}
#div1{
float:left;
}
#div2{
overflow:hidden;
background: yellow;
}
Answer the question
In order to leave comments, you need to log in
<div style="float:left;">Первый див</div><div>Второй див</div>
#div1 {
float: left;
background: blue
color:white;
height:100%;
width:200px;
}
#div2{
height: 100%;
background:yellow;
color: blue;
margin-right:200px;
width:100%;
}
#all{
width:100%;
}
HTML
<div id="all">
<div id="div1"> Content1 </div>
<div id="div2">Content2 </div>
</div>
If the table view as such solves the problem, then take a closer look at display: table emulation for IE6/7 .
cssdesk with all due respect to what was written above, I don’t think it’s necessary to pervert like that ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question