I have:
<section>
<ul>
<li>....</li>
<li>....</li>
<li>....</li>
..
</ul>
</section>
I want the <li>
to be floating left and at the end of of these <li>
, right after the </ul>
, I need to put an element as clear: both;
in order to keep section
s block integrity.
Which html5 element would be most suitable for this purpose?
Should I go for an invisible hr
? a div
?
Thank you.
None, use the overflow: hidden
trick where appropriate.
If that isn't suitable, use a pseudo element. For example, you could use...
ul:after {
content: "";
clear: both;
display: block;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With