我在嘗試在兩行之間放置邊框時遇到了一些麻煩。它目前只做第一行。浮動div丟失父母課程明確:都;?
我已經使用clear:both;對於一排新的div,但它似乎帶走了邊界的父div風格。
<style type="text/css">
.box {
border: 1px solid #E5E5E5;
border-radius: 4px 4px 4px 4px;
width: 90%;
}
</style>
<div class="box">
<div style="float:left; width:150px;">
Row 1, Column 1
</div>
<div style="float:left; width:150px;">
Row 1, Column 2
</div>
<div style="clear:both;"></div>
<div style="float:left; width:150px;">
Row 2, Column 1
</div>
<div style="float:left; width:150px;">
Row 2, Column 2
</div>
</div>
感謝
感謝有點骯髒的時刻;) – arbme 2012-02-14 02:50:45
我的榮幸! :) – davidgmar 2012-02-14 02:58:42