Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS What is the best way of clearing floats in css? Re: What is the best way of clearing floats in css?

#122351
rosspenman
Participant

I usually use this one:

::after {
clear: both;
display: block;
content: “”;
}

In the event that I have already used up my `::after` pseudo-element, or I need to support ancient browsers, I would use `overflow: hidden;` or `overflow: auto;` depending on the situation.