自动调整BG和黑色底部尺寸

时间:2011-12-16 01:55:39

标签: html css html5 xhtml css3

我试图想办法让两者都有,但是我无法弄清楚如何。

我在页面底部有一个黑条,使用:

body {
    background-image:url(../images/bottom_black.gif);
    background-repeat: repeat-x;
    background-position: 0px 800px;
}

工作正常,但我也想要一个径向渐变bg,所以我做了一个并放置了这个代码,使其自动重新调整大小以适应不同的分辨率:

html {
    background:url(../images/bg.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

他们每个人都很好地工作但不在一起。我知道它们都是背景图像,这就是为什么但必须有一些解决方法。请帮忙!

以下是测试链接:

Re-Size BG

Black Bottom

1 个答案:

答案 0 :(得分:0)

你可以试试这个

html {
    background:url(../images/bg.jpg) no-repeat center center fixed;
    -webkit-background-size: 100% auto;
    -moz-background-size: 100% auto;
    -o-background-size: 100% auto;
    background-size: 100% auto;
}
相关问题