the code is the following:
(CSS)
#container {
border:1px dashed #000;
overflow:hidden;
}
#content, #sidebar {
float:left;
width:50%;
}
#content {
background:yellow;
}
#sidebar {
background:grey;
}
#sidebar {
height:100%;
}
(HTML)
<div id="container">
<div id="content">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, Lorem ipsum dolor sit amet, consectetuer adipiscing elit</p>
</div>
<div id="sidebar">
<p>Few words</p>
</div>
</div>
I would like to see a #sidebar
div with same height, like the #content
div, is it possible without absolute position? Online version: http://jsfiddle.net/yJbUW/
Just use this code before the container closing Div, works for me!
You can also try below code
CSS
goes hereand update HTML as follows,
It can be solved with
#content, #sidebar { display: table-cell; width:50%; }
You can do that by displaying the
#container
as table and displaying#content
and#sidebar
as table-cells:Check your updated Fiddle.