<ul style="overflow-y: auto;">
<li><img style="float: left;"/>some text...</li>
<li><img style="float: left;"/>some text...</li>
<li><img style="float: left;"/>some text...</li>
</ul>
Is it neccessary with some kind of clearfix here? Or does each floating <img/>
only affect the content of its corresponding <li>
?
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {
display: inline-block;
}
* html .clearfix {
height: 1%;
} /* Hides from IE-mac */
.clearfix {
display: block;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…