請參閱截圖。我試圖製作一個佈局,允許我使用div左側(headerLeft)和右側(headerRight)將陰影應用於主div的任一側,然後我擁有包含標題內容的內容div(標題)。這全部包裹在一個div(headerWrapper)中。我使用4個div來做到這一點。我有它在我的標題,導航欄和我正在使用的另一個欄上工作。這在屏幕截圖中用顏色編碼的div顯示。這工作的原因是因爲我的CSS使用像素給定的高度。但是我有問題。我想將此應用於我的主要內容,但不起作用。內容在頁面之間的高度會發生變化,這很好,但是我的包含陰影的div不會出現,除非我給他們一個固定的像素高度。請幫助。紅色區域顯示包含陰影的左側和右側div應顯示在哪裏。幫助DIV佈局和CSS高度
layoutProblem http://www.webquark.co.uk/layoutProblem.jpg
這裏是CSS我對這項工作的佈局:
#header{
margin:0 auto;
height:160px;
width: 76%;
min-width:850px;
font-size: 14pt;
font-family: Calibri, Verdana, Ariel, sans-serif;
color: #ffffff;
background-image: url(headerBG.jpg);
background-repeat: repeat-x;
}
#headerWrapper{
height:145px;
width:100%;
/**background-color: #202020;**/
}
#headerLeft
{
float: left;
width: 12%;
height:145px;
background-image: url(shadowLeft.png);
background-repeat: repeat-y;
background-position: center right;
/**background-color: #1e1e1e;**/
}
#headerRight
{
float: right;
width: 12%;
height:145px;
background-image: url(shadowRight.png);
background-repeat: repeat-y;
background-position: center left;
/**background-color: #1e1e1e;**/
}
Basicly我想我需要離開使左,右的div高度100%的,我已經嘗試設置高度到100%,但它沒有工作。我也有我的身高設置爲100%
乾杯,希望你能幫助。
HTML的工作頂欄和標題:
<div id="topWrapper">
<div id="topRight">
</div>
<div id="topLeft">
</div>
<div id="top">
</div>
</div>
<div id="headerWrapper">
<div id="headerRight">
</div>
<div id="headerLeft">
</div>
<div id="header">
</div>
</div>
你可以發佈你的html以及嗎?或鏈接到您的演示頁面/正在進行中的頁面?我可以看看CSS在做什麼,但很難確定它沒有看到它所附帶的內容。歡呼=] – 2009-08-13 17:20:41
我已添加我的html – 2009-08-13 17:42:03