2013-04-29 49 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