CSS背景和身高100% [英] CSS background and body height 100%

查看:144
本文介绍了CSS背景和身高100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有麻烦我的背景图片跨越我的内容的全部。

I am having trouble getting my background image to span the entirety of my content.

我看着别人的质疑,看来我需要设置的每个容器上的100%,最小宽度......但我想尽组合,它仍然不能正常工作。

I looked at other questions and it seems that I need to set a min-width of 100% on each container... but I tried every combination and it still wasn't working.

下面是我的HTML:

<body>
<div id="container">

    <div id="header">
                 header content...             
    </div>
    <div id="content">

        <div id="myAccountArea" class="section">
            accountArea content...
        </div>

        <div id="myPostsArea" class="section">
        postsArea content...
        </div>

    </div>
    <div id="footer">
    </div>
</div>

CSS:

html, body {
    margin: 0;
    padding: 0;
    height:100%
}

body {
    background: red;
}

#container {
    padding-top: 80px;
    margin-left: auto;
    margin-right: auto;
    width: 1000px;
    min-width: 1000px;
}

#content {
    min-width:1000px;
}

我遇到的问题是,postsArea含量通常跨越不是浏览器的窗口中多,但背景没有。

The problem I am having is that the postsArea content usually spans more than the browser's window, but the background does not.

感谢

修改

好了,我把范围缩小到一个reset.css文件...要去关于在该文件中发现问题任何提示?

Ok, so I narrowed it down to a reset.css file... Any tips on going about discovering the problem in that file?

感谢。

推荐答案

好了,看着在复位后的样式表,我发现这一点:

Ok, so after looking at the reset stylesheet, I discovered this:

html {
     background:#FFF
}

本评论线路输出和一切似乎是罚款:)

Commented this line out and everything seems to be fine :)

非常感谢所有帮助

这篇关于CSS背景和身高100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆