我正在尝试制作以下内容,基本上是一页断了六块
__________
| | | |
| | | |
|__|__|__|
| | | |
| | | |
| | | |
----------
但我得到的看起来像这样:
__________
|__|__|__|
|__|__|__|
| | | |
| | | |
| | | |
| | | |
----------
这是CSS:
.paginationPage {
height: 110px;
width: 82px;
margin: 2px;
background: #F9F9F9;
border: 1px solid #CCCCCC;
}
#insertionGrid {
position: relative;
height: 100%;
width: 100%;
}
#odds, #evens {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
#odds {
z-index: 1;
}
#evens {
z-index: 2;
}
.insertionBlock {
float: left;
}
.oneSixth {
height: 50%;
width: 33%;
}
.oneEigth {
height: 25%;
width: 50%;
}
这是HTML:
<div class="paginationPage">
<div id="insertionGrid">
<div id="odds">
<div>
<div id="o1" class="oneSixth insertionBlock"> </div>
<div id="o2" class="oneSixth insertionBlock"> </div>
<div id="o3" class="oneSixth insertionBlock"> </div>
</div>
<div>
<div id="o4" class="oneSixth insertionBlock"> </div>
<div id="o5" class="oneSixth insertionBlock"> </div>
<div id="o6" class="oneSixth insertionBlock"> </div>
</div>
</div>
</div>
</div>
paginationPage 是 110 像素,里面的东西是高度 100%,除了一个第六类是 50%。那么为什么 oneSixth div 占据了 10% 而不是 50% 之类的东西呢?