I don\'t know if it\'s a common problem, but I can\'t find the solution in web so far. I would like to have two divs wrapped inside another div, however these two divs insid
Here's another, I found helpful. It works even for Responsive CSS design too.
#wrap
{
display: table;
table-layout: fixed; /* it'll enable the div to be responsive */
width: 100%; /* as display table will shrink the div to content-wide */
}
WARNING: But this theory won't work for holder contains inner elements with absolute positions. And it will create problem for fixed-width layout. But for responsive design, it's just excellent. :)
With CSS3, in a dynamic portion, you can add clear float to the last element by:
#wrap [class*='my-div-class']:last-of-type {
display: block;
clear: both;
}
Where your divs are:
>
content
}
Reference: