2011-01-10 71 views
1

我試圖強制我的內容 div填充整個包裝股利。有什麼特別的使用最小高度的百分比?

包裝設置爲強制我的頁腳到窗口底部或頁面。它做得很好。

如果我使用:
最小高度:500px(或40em); div按照要求拉伸。

但是,如果我使用:
最小高度:100%(或任何其他%); 內容 div沒有任何反應。

這對我來說沒有意義。我錯過了什麼?

每(不包括邊框和顏色的東西)的要求:

* { 
    margin: 0; 
} 
html, body { 
    height: 100%; 
} 
#wrapper { 
    min-height: 100%; 
    width: 80%; 
    margin: 0 auto -4em; 
} 
#content { 
    min-height: 100%; // nothing happens, change to em or px something happens. 
} 
#sidebar { 
    float: right; 
} 
#footer { 
    clear: both; 
    height: 4em; 
} 
#push { 
    height: 4em; 
} 

<body> 
    <div wrapper> 
    <div header> 
     <div menu></div> 
    </div> 
    <div sidebar></div> 
    <div content></div> 
    <div push></div> 
    </div> 
    <div footer></div> 
</body> 

回答

0

您可以嘗試使用 「的line-height:100%」 在您的內容股利。雖然...如果您的包裝div上有明確的高度設置,您應該可以在各種高度測量值之一上使用100%來強制其展開。

發佈一些快速示例標記,顯示你的包裝和你的內容。

+0

好的。我已經添加了一些代碼。 – Humpton 2011-01-10 20:31:29