2009-05-28 55 views
0

我正在構建一個3欄的網頁(頁眉&左側導航欄上方的菜單欄,主區域和右側欄,底部有一個全寬頁腳)。每列都有背景顏色,但是在文本末尾切掉而不是填充整列。有沒有辦法填充不依賴於使用表(td)的整個列?css全高?

這裏是我的總體佈局CSS:

#container 
{ 
    float: left; 
    width: 100%; /* IE doubles the margins on floats, this takes care of the problem */ 
    display: inline; /* this is where Ryan Brill (author of the ALA's article) and I go in "opposite directions" */ 
    margin-left: -200px; 
} 
#left 
{ 
    float: left; 
    width: 180px; /* IE doubles the margins on floats, this takes care of the problem */ 
    display: inline; 
    margin-left: 200px; 
    padding: 0px 0px 0px 5px; 
    background: url('/App_Themes/Default/images/RightColumnBackground.png') repeat left top; 
} 
#main 
{ 
    /* the width from #left (180px) + the negative margin from #container (200px) */ 
    margin-left: 380px; 
    padding: 0px 0px 0px 5px; 
} 
#sidebar 
{ 
    /* this is to keep the content of #sidebar to the right of #main even if the content of "main is shorter */ 
    padding-left: 100%; /* this is to "bring back" the #sidebar that has been moved out of the viewport because of the padding value */ 
    margin-left: -220px; 
} 

我知道我可以設置樣式的高度,但該引腳的高度一定數量的像素。是否有height: fill;類型選項?

回答

2

這是一個非常普遍的問題。一個好方法是使用faux columns

1

不在任何目前在瀏覽器中廣泛支持的CSS,但有ways of approximating it

+0

因爲我的中心列是可變寬度我不認爲這會對我有用(除非我找出如何做滑動門技術)。也許,現在,一張小桌子可以滿足我的需要。 <感嘆/ > – 2009-05-28 04:19:42