在.SalesPanel
類中,我已將它設置爲100%寬度。我注意到它重疊了我在content
id中設置的右側填充。100%寬度弄髒填充
請參閱:http://jsfiddle.net/CBAE7/9/並查看正確的填充並將其與左填充進行比較。
是什麼導致了這種情況,以及如何解決?
另外,我期待3行的1行甚至使用100%的寬度..如何解決?
HTML:
<div id='content'>
<div class='SalesPanel'> One </div>
<div class='SalesPanel'> Two </div>
<div class='SalesPanel'> Three </div>
</div>
CSS:
#content {
width: 700px;
padding: 8px;
overflow: hidden;
background-color: white;
border: 1px solid #C8CCD5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.SalesPanel {
border:1px solid #dddddd;
height:30px;
float:left;
width: 100%
}
您的jsfiddle並不能反映你的代碼。 – cereallarceny
我已經添加了一個截圖,所以你可以看到我的意思 –
對,你在帖子中列出的小提琴是一個不正確的鏈接。 http://jsfiddle.net/j08691/CBAE7/6是正確的。 – cereallarceny