我在 Jquery 和jsFiddle中创建了几行 div
生成的html是
<div id="thisPage">
<div id="vehicles" class="wrapper">
<div class="divd spacer"> </div>
<div id="Paul " title="Driver Details" class="divd i100">i1001<br>Paul </div>
<div id="Simon " title="Driver Details" class="divd i100">i1002<br>Simon </div>
<div id="Phil " title="Driver Details" class="divd i100">i1003<br>Phil </div>
<div id="Lee " title="Driver Details" class="divd i100">i1004<br>Lee </div>
<div id="Martin" title="Driver Details" class="divd i100">i1005<br>Martin </div>
<div id="" title="Driver Details" class="divd i100">i1006<br></div>
<div id="Tom Robson" title="Driver Details" class="divd i60">i601<br>Tom Robson</div>
<div id="Alan Linney " title="Driver Details" class="divd i60">i602<br>Alan Linney </div>
</div>
<div id="vehicles" class="wrapper" style="top:60px">
<div id="2013-03-11" class="divd dateWeekday">Monday 11<br>March</div>
<div id="Paul " title="Driver Details" class="divd i100"> JOB D </div>
<div id="Simon " title="Driver Details" class="divd i100"> JOB D </div>
<div id="Phil " title="Driver Details" class="divd i100"> JOB D </div>
<div id="Lee " title="Driver Details" class="divd i100"> JOB D </div>
<div id="Martin " title="Driver Details" class="divd i100"> JOB D </div>
<div id="" title="Driver Details" class="divd i100"> JOB D </div>
<div id="Tom " title="Driver Details" class="divd i60"> JOB D </div>
</div>
</div>
样式是
.wrapper {
position:absolute; vertical-align:middle ;
}
.divd {
display: inline-block;
margin:2px 2px 2px 2px ;
width: 50px;
height: 50px;
border: 1px solid black;
background-color:#999;
border-radius:5px;
z-index:200;
text-align:center;
vertical-align:bottom ;
}
.dateWeekday {
width: 120px;
background-color:#9CF ;
margin:2px 2px 2px 2px ;
}
.spacer {
width: 120px;
margin:2px 2px 2px 2px ;
}
一切正常,但浏览器中的结果显示第二行偏移到第一行,如下图红线所示,我该如何纠正这个?请问有什么帮助吗?