我对这个问题感到疯狂:为什么第二个“socialHighlights”div与第一个不一致?我注意到如果我用舍入的类取出div,那就很好......我做错了什么?提前谢谢!
CSS:
.roundedVisited{
background-color: pink; padding:2px; padding-left: 5px; padding-right: 5px; }
.outerHighlightBox
{
position: relative; width: 180px; background-color: #eee;
}
.socialHighlights
{
position: relative; height: 25px; width: 168px; padding: 6px 2px 2px 10px; font-family: Arial; font-size: 13px; background-color: #ccc;
}
HTML代码:
<div class='outerHighlightBox' style='margin-left: 0px; margin-top: 25px;'>
<div class='socialHighlights' style='margin-left: 0px; '>
<div style=' float: left; margin-right: 5px; position: relative;'>1st icon</div>
<div style='float: left;' id='liIcon2'>2nd Icon</div>
<div class='roundedVisited' style='float: right;'>51</div>
</div>
</div>
<div class='outerHighlightBox' style='margin-left: 190px; margin-top: 25px;'>
<div class='socialHighlights' style='margin-left: 0px; '>
<div style=' float: left; margin-right: 5px; position: relative;'>1st icon</div>
<div style='float: left;' id='Div1'>2nd Icon</div>
<div class='roundedVisited' style='float: right;'>23</div>
</div>
</div>