【问题标题】:css min-width doesn't work in googlechromecss min-width 在谷歌浏览器中不起作用
【发布时间】:2013-04-22 17:51:52
【问题描述】:

我设计了一个带有页眉页脚和正文标签的页面。对于页眉和页脚,我设置了宽度:100%;我设置了一个最小宽度:1024px;在 Firefox 和 IE 中它运行良好,当最小化窗口时,它保持其最小尺寸,但在 googlechrome minwidth 中不起作用,当我最小化窗口页眉和页脚时只有窗口的宽度,当我向右滚动时有空白空间和它没有扩展 100%,但对于内容来说一切都很好。 我在这里放了一些html和css代码。

<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; 
        }

感谢您的帮助。

【问题讨论】:

    标签: html css


    【解决方案1】:

    最小宽度在 chrome 中运行良好。

    也许你需要设置在后台才能看到效果:

     #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/

    【讨论】:

    • 在 jsfiddle 中一切正常,但在我的代码中有更多细节它不起作用,我不知道问题出在哪里。
    • 有没有机会链接到您的网站,@Somy J?这是一个非常标准的设置。
    猜你喜欢
    • 2016-05-07
    • 1970-01-01
    • 1970-01-01
    • 2011-12-04
    • 2015-11-18
    • 2011-02-15
    • 2020-04-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多