2011-02-17 58 views
0

我正在處理一些小問題。我爲所有頁面使用標準容器高度和CSS代碼。對於大多數頁面來說,有足夠的內容可以填充它,而對於某些內容而言,頁面可能只佔10-20%。那麼這些頁面使用不同的最小高度是一個好主意嗎?下面是代碼:更改集裝箱高度

#wrapper { 
    background-color: #999999; 
    margin:0 auto; 
    min-height: 600px; 
    width:770px; 
    font-family: "Lucida Grande", Verdana, "Lucida Sans Unicode", Arial, Helvetica, 
    sans-serif; 
    font-size:15px; 
    color: #222222; 
    margin-left:60px; 
    margin-bottom:60px; 
} 

回答

3

它可能會更好聲明較小min-height在一個單獨的類。

然後,你可以做<div id="wrapper" class="smallerContent">

#wrapper.smallerContent { 
    min-height: 300px 
}