我正在尝试使用浮动元素制作一个 2 列的“表格”:
<ul>
<li class="odd">This will appear on the left</li>
<li class="even">This will appear on the right</li>
<li class="odd">This will appear on the left (2)</li>
<li class="even">This will appear on the right (2)</li>
<li class="odd">This will appear on the left (3)</li>
<li class="even">This will appear on the right (3)</li>
</ul>
CSS:
ul {
margin: 20px 0px;
width: 880px;
}
li {
position: relative;
float: left;
width: 410px;
margin: 0px 0px 10px 0px;
padding: 0;
}
.odd { clear: left; }
.even {
clear: right;
margin-left: 50px;
}
这很好用,但在 IE6 中,even
元素不清晰,最终水平堆叠在第一行。我怎样才能解决这个问题?