- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Alright…
So I have a div (content-wrap) that is holding two columns.
As soon as I apply a float to any of the objects inside of the div, the height:auto; for content-wrap no longer works.
any thoughts?
you have to clear your floats
try these two techniques
div#content-wrap:after
{
content: ".";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
or you can add a <br class="clear"/> right after your div#content-wrap
and in the css
.clear {clear:both;}
hope it helps
pab
seems to have worked.
thank you thank you…
glad it helped.
which one did you end up using?
pab
I used the first one.
div#content-wrap:after
{
content: ".";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
https://css-tricks.com/all-about-floats/
is brlliant and explains all you need to know about floats, understanding them is so important, so that you can fix problems, I found this really useful. Chris also did a really cool video on this subject it’s about 15mins long but well worth watching