Home › Forums › CSS › So I ran some of my code through W3C’s validator…….. › Re: So I ran some of my code through W3C’s validator……..
March 9, 2013 at 7:12 am
#127590
Participant
Clearfixes you can or can’t use with a menu:
/* can’t use this – you won’t see the child dropdowns as they go outside UL! */
ul {
overflow: hidden;
}
/* pseudo clearfix element */
ul {
width: 100%; /* give any width (to trigger hasLayout in older IEs, gives the same end result) */
}
ul:after {
clear: both;
content: ”;
display: block;
}
I find it a bit odd people keep on writing their CSS-minded elements and attributes in HTML. I mean things like this:
- …
…
…
Personally I rather just keep it all in CSS and not add extra stuff to HTML just because I need a clearfix.