2010-10-26 83 views
1

我需要做一個佈局,看起來像這樣:CSS - 絕對定位和流體的div

[250px - fixed div] [fluid div, must expand depending on the width of the body and the 2 divs next/before it] [250px - fixed div] 

這可能嗎? 所有3格的容器也是液體(100%寬度)。 所有這些div包含背景圖像(左+右+重複中心圖像),應該留在後面。

+0

Ofcourse這是可能的,谷歌周圍「CSS 3欄佈局」或不同的關鍵字,有很多的例子在那裏了! – jolt 2010-10-26 21:01:01

回答

2

我建議您閱讀The Holy Grail一個完整的教程步行通過和必要的瀏覽器黑客的描述,例如用於創建佈局。另外,我建議你考慮在包含元素或流體div上放置一個最大寬度(例如:#container {max-width:1024px;}),因爲在特別高的分辨率/大屏幕上,拉伸div會變得令人討厭地大到用戶沮喪的地步。