2013-04-29 42 views
0

我设计了一个页眉和页脚以及body标签。为页眉和页脚设置宽度:100%;我设置了最小宽度:1024px;在Firefox和IE浏览器工作得很好,当最小化窗口时,它保持其最小尺寸,但在googlechrome最小宽度不工作,当我最小化窗口页眉和页脚只有窗口的宽度,当我滚动到右侧有白色空间和它不会延长100%,但对于内容,所有的事情都可以。 我在这里放了一些html和css代码。css min-width在googlechrome中不起作用

<div id="f-page"> 
    <div style="width:100%; min-width:1024px; z-index:800; 
    background-image:url(fimages/headerbg.gif); height:120px;"> 
    <center> 
    <div id="f-header"></div> 
    </center> 
    </div> 
    <div id="f-mypage"></div> 
    <div id="f-footer"> 
    <center> 
    <br /> 
    <h6> some text</h6> 
    </center>    
</div> 
</div> 

CSS:

#f-footer 
     { 
      height:70px; min-width:1024px; 
      background-image:url('../f-images/ffoot.png'); 
      background-repeat:repeat-x; 
     } 
#f-header {width:1024px;height:120px;z-index:1000;} 
#f-page {margin:0 auto;} 
#f-mypage 
     { 
      width:1004px;height:auto; background-color:White; margin-top:10px; 
      padding-bottom:30px;border:1px solid #cccfcb; 
      -moz-box-shadow:5px 0 5px -5px #333,-5px 0 5px -5px #333; 
      -webkit-box-shadow:5px 0 5px -5px #333,-5px 0 5px -5px #333; 
      box-shadow:5px 0 5px -5px #333,-5px 0 5px -5px #333; 
     } 

谢谢你的帮助。

回答

0

最小宽度在铬中工作正常。

也许你需要设置后台看看效果:

#f-footer 
    { 
     height:70px; min-width:1024px; 
     background-image:url('../f-images/ffoot.png'); background-repeat:repeat-x; 
     background: red; 
    } 

工作小提琴: http://jsfiddle.net/basarat/uPTSd/

+0

在的jsfiddle每一件事情是确定的,但在我的代码,有更多的细节这是行不通的,我不知道问题在哪里。 – 2013-04-29 06:51:58

+1

任何机会链接到您的网站,@Somy J?这是一个非常标准的设置。 – 2013-04-29 08:12:25