I have this simple example:
<header>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li class="clear"></li>
</ul>
</header>
<section>section</section>
And this piece of css:
BODY, HTML{
margin: 0;
}
header{
margin-bottom: 100px; /* section goes down */
}
UL{
list-style-type: none;
}
UL LI{
float: left;
background: green;
}
.clear{
clear: both;
float: none;
}
section{
background: red;
}
So I expecting to "header" goes straight to top-left corner, then 100px margin, then "section". In all major browsers that works as expected, but in Firefox (version 16) "header" get extra margin-top for some reason.
Is this a bug?
Here an jsfiddle example: http://jsfiddle.net/AvZek/2/
BTW
If I used clearfix instead of "clear" class than it's working just fine.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…