此問題最簡單的方法是顯示jsfiddle。Html - Div Table - 背景顏色無法使用邊距,填充,邊框
http://jsfiddle.net/jaa17/E8Skp/
<body style="width:100%; height: 100%; padding: 0 0 0 0; margin: 0 0 0 0; overflow: hidden; background:#999999">
<p>I want the red/green of the table's/row's background showing through on the left and the right, not the body's background grey. (Note the 10 pixel padding in the table's row/column.)</p>
<p>And what has happened to the padding on the right? That needs to be red/green too.</p>
<p>And these blue sections should be on the same line.</p>
<p>What do I use, margins, borders, padding???? Nothing seems to work.</p>
<div style="width:100%; height: 100%;">
<!-- A Div Table -->
<div style="text-align: center; width: 100%; display:block; padding-top:0px; padding-bottom:0px; padding-left: 0px; padding-right: 0px; background-color: #FF0000;">
<!-- Row -->
<div style="text-align: center; width: 100%; display:block; padding-top:0px; padding-bottom:0px; padding-left: 10px; padding-right: 10px; background-color: #00FF00;">
<!-- Column -->
<div style="float: left; width: 50%; display:block; padding-top:0px; padding-bottom:0px; padding-left: 10px; padding-right: 10px; background-color: #0000FF;">
<button type="button">Some Html Stuff</button>
</div>
<!-- Column -->
<div style="float: left; width: 50%; display:block; padding-top:0px; padding-bottom:0px; padding-left: 10px; padding-right: 10px; background-color: #9999FF;">
<button type="button">Some Html Stuff</button>
</div>
</div>
</div>
</div>
</body>
我想表的/行背景的紅色/綠色顯示在左側和右側,而不是身體的背景灰度通過。 (請注意表格的行/列中的10像素填充。)
然後發生了什麼?這也需要紅/綠。
而這些藍色部分應該在同一行上。
我該如何使用邊距邊框填充?似乎沒有任何工作。