页脚背景图像css

时间:2011-12-02 21:05:06

标签: css xhtml footer

美好的一天, 当我调整浏览器大小时,我有一个关于我的页脚图像没有伸展的问题。 我尝试使用粘性页脚,但我认为它不起作用。

我使用960网格作为我的布局,所以我必须创建一个不同的div来包裹我的页脚背景,以便它在浏览器中运行...

出于某种原因,当我拉伸浏览器时,我的背景图片底部(页脚部分)会出现这个空白区域。

我的xhtml就是这样的..请随时在这里预览我的网站:http://www.ofsgraphics.com/ofsv3

<body>
    <div id="container">
        <div id="contentMainBackground"></div> <!-- background image for content */
             <div id="contentMain" class="container_12"></div>

    </div><!-- end of container -->         

    <div id="footerMainBackground"></div><!-- background image for footerMainBackground -->
         <div id="footer" class="container_12"></div>


CSS:
    #footerMainBackground {
        background:url("../images/footer_bg.jpg") repeat;
        min-height:150px;
        width:100%;
        position:fixed;
        overflow:hidden;
        clear:both;
    }
        #footer {
        padding:30px 0 0 0;
        }

我真的很感谢你的帮助。

谢谢。

1 个答案:

答案 0 :(得分:0)

你能做的就是把背景图片放在你的身上,并让其他所有元素都有自己的背景。

身体的宽度也应为100%,身高应为100%。

所以现在你的背景将占用另一个div未涵盖的所有页面。