- This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 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.
`
`
And when can I use this? starting to get into web development. I saw this being used a lot
What does a colon do is what you’re asking? Could do a lot of things, depending on the context. You’ll have to be a lot more specific.
I think we miss the link.
div style=”clear:both;” div
Basically, it clears floated elements to ensure that the element it is applied to appears underneath any floated elements.
This technique is getting old, progressively disappearing. We’re not using extra HTML element to clear floats anymore.
So what is the new technique?
/* Optional if you don't plan to support IE6/7 */
.parent-element {
*zoom: 1;
}
/* Modern browsers */
.parent-element:after {
content: "";
display: table;
clear:both;
}
You can read about the best solution (clearfix) [here](http://nicolasgallagher.com/micro-clearfix-hack/)