代碼雲:周邊div標籤不適背景色
<div id="wrapper">
<div id="content">
<!-- content -->
</div>
<div id="sidebar">
<!-- sidebar -->
</div>
</div>
我應用background-color
爲包裝,但它並不顯示,除非我設置一個固定的高度。爲什麼它會考慮內容和邊欄填充封裝?還有什麼其他方法可以讓background-color
在沒有設置固定高度的情況下出現?
#content和#sidebar是否浮動?將#wrapper設置爲「overflow:hidden;'。 – Marwelln 2011-05-01 10:54:19
我們可以看到將背景色應用於包裝的代碼/ css。 – 2011-05-01 10:54:57
是的,請向我們展示#wrapper,#content和#sidebar的CSS。 – Midas 2011-05-01 11:18:59