我遇到的問題是我的頁面頂部有兩個div,一個包含重複的藍色背景,另一個包含背景圖像。Div高度/溢出問題
我必須設置兩個div的高度,以便它們垂直擴展,不隨內容擴展。我在右側設置了溢出的形式。我相信這是造成問題的原因。
我已經嘗試沒有在代碼中的高度CSS,但它仍然不會垂直擴展。
爲了讓背景顯示出來,我必須手動設置高度。
這是網頁:http://www.repipespecialists.com/landing/google/repiping.html
這是CSS代碼:
#top_container {
width:100%;
height:1040px;
background-image:url(../images/top_bg_repeat.jpg);
background-repeat:repeat-x;
background-color:#83b4e9;
}
#top_header {
width:1200px;
height:1040px;
background-image:url(../images/header_bg.jpg);
background-repeat:no-repeat;
background-color:#83b4e9;
margin: 0 auto;
}
很抱歉,但我不知道我明白你正在努力去做。你能不能把你有什麼和你想要得到的東西相提並論?相關標記和CSS(或簡化示例)的代碼片段也會非常有用。 – Zhihao 2012-07-24 01:18:50
我想獲得top_container和top_header divs,以自動垂直擴展內容。相反,我不得不指定高度 – user1454988 2012-07-24 01:25:42