html - CSS:页面和宽度 100%

标签 html css

现在我可能在这里很愚蠢,但我有以下 css:

*{
    margin:0;
    padding:0;
}

body {
    background:url(../img/bg/bg-body.jpg) repeat top left #f0f0f0;
    font-family:"ProximaNova", Arial, Helvetica, sans-serif;
    color:#ffffff;
    width:100%;
}

#header {
    background: #000000;
    border-bottom: 1px solid #282828;
    height:126px;
    min-width:1000px;
    zoom:1;
}

#header #nav {
    height:46px;
    line-height:46px;
    margin-top:10px;
    background:url(../img/bg/nav/nav-bg.png) repeat-x top left #000000;
}

问题是当用户放大页面时会发生这种情况:

而它应该是这样的:

我需要这方面的帮助,如果能得到任何帮助,我将不胜感激。

@Jessica,这是html代码:

<div id="header">

<div id="content-wrap" class="header">

<div id="logo"></div>

<!--Begin News-->
<div id="news-scroller">
<b>Recent News: </b>
    <span id="quote-left">"</span>
        <div id="news-content">
            <a href="#">
            <?php
            if (mysql_num_rows($news)== 0){
                echo "There is currently no news from the Bowlplex Doubles, however there will be soon!";
            } else {
            echo $output['content'];
            }
            ?>
            </a>
        </div>
    <span id="quote-right">"</span>
    <div id="post">
        <b>Posted</b> <?php echo $output['date'].",&nbsp;".$output['time']; ?>
    </div>
</div>
<!--/End News-->

</div>

<!--Begin Navigation-->
<div id="nav">

<ul>

<a href="/"><li class="active">Home</li></a>
<a href="/scores"><li>Scores</li></a>
<a href="/entries"><li>Entry Forms</li></a>
<a href="/scoreboard"><li>Live Scoreboard</li></a>
<a href="/contact"><li>Contact</li></a>
<a href="/archive"><li class="last">Archive</li></a>

</ul>

</div>
<!--/End Navigation-->

</div>
<!--/End Header-->

更新

新代码:

body {
    background:url(../img/bg/bg-body.jpg) repeat top left #f0f0f0;
    font-family:"ProximaNova", Arial, Helvetica, sans-serif;
    color:#ffffff;
    width:100%;
}
#header {
    background: #000000;
    border-bottom: 1px solid #282828;
    height:126px;
    min-width:100%;
    min-width:1000px;
    zoom:1;
}

但是问题依然存在。

最佳答案

min-width:1000px David,也尝试将此属性设置为百分比。您的 HTML 代码是什么样的?可以发帖吗。

关于html - CSS:页面和宽度 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11479011/

相关文章:

jquery - 根据元素数量更改点击变量 - jQuery

css - Div 溢出未正确隐藏

html - 使 2 个 div 具有相同的高度(使用 Full Fiddle 工作)

html - 我想将文本再拉伸(stretch)一点,但是 "text-align: justify"没有按照我的意愿进行

html - 在基于 HTML 的小型网站上包含/更新公共(public)元素的最佳方式

html - 为什么选项卡菜单图像必须比菜单尺寸大?

html - 浏览器放大/缩小与不同屏幕尺寸相同吗?

html - 如何不使用绝对定位 CSS

JavaScript 文件无法与 servlet 一起正常工作

c# - 如何从代码隐藏属性中获取样式属性的值?