2013-02-21 44 views
0

當我在屏幕上恢復窗口或測試屏幕分辨率時。當你使用靜態導航時,你如何使div保持中心位置

我的html5播放器隱藏到導航中的內容。

這裏是網站 http://djwckd.com/

CSS

#sidenav { 
     background-image:url('http://i1285.photobucket.com/albums/a592/djwckd/wckd-bg2_zps36505f8f.jpg'); 
     width: 225px; 
     position: fixed; /*--Fix the sidenav to stay in one spot--*/ 
     float: left; /*--Keeps sidenav into place when Fixed positioning fails--*/ 
     text-align:center; 
     height: 100%; 
    } 

#content { 
    background-image:url('http://i1285.photobucket.com/albums/a592/djwckd/wckd-bg1_zpsf32da4c1.jpg'); 
    float: right; /*--Keeps content to the right side--*/ 
    width:85%; 
    text-align: center; 
    font-family:Trebuchet MS; 
    color: #000; 
    height: 100%; 

} 

.bottom { 
    background-image:url('http://i1285.photobucket.com/albums/a592/djwckd/wckd-bg3_zps849e973b.png'); 
    font-family:Trebuchet MS; 
    width:400px; 
    margin:0 auto 0 auto; 
    padding:5px; 
    border:1px solid #cccccc; 
    font-size:12px; 
    color: #777777; 
} 

.copy { 
    background-color: #fff; 
    color: #000; 
    font-family:Trebuchet MS; 
    font-size:14px; 
    height: 100%; 

} 

回答

0

添加min-width到側邊欄和內容兩者的容器修復該問題,但將在瀏覽器上寬度小於最小寬度添加滾動指定。

div.container { min-width:1024px; } 

這可以防止容器永遠小於1024px。

+0

有沒有辦法讓整個網站縮小並保持在任何分辨率相同的大小? – user2094719 2013-02-21 09:42:12

+0

使用媒體查詢,您可以調整特定分辨率的元素大小:http://www.w3.org/TR/css3-mediaqueries/&http://css-tricks.com/css-media-queries/ – 2013-02-21 09:46:43

相關問題