0

我的body元素有多种背景。

body { background:linear-gradient(to bottom, rgba(255,255,255,0) 10%, rgba(182,176,157, .5) 100%),url("images/flower-bg.jpg") repeat #eae7de }

它在最新版本的 IE、FF 和 Chrome 中显示良好。但是,这两种背景都没有出现在 Safari 中。

这里是网站。

有人可以帮我指出我哪里出错了吗?

编辑:试过这个,但它没有用。

body {
    background:-webkit-linear-gradient(to bottom, rgba(255,255,255,0) 10%, rgba(182,176,157, .5) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    background:linear-gradient(to bottom, rgba(255,255,255,0) 10%, rgba(182,176,157, .5) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    }

编辑2:试过这个,但也没有用。现在没有任何浏览器的背景显示。

body {
background-image: linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
background-image: -o-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
background-image: -moz-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
background-image: -webkit-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
background-image: -ms-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    }

编辑 3:这就是我其余的正文代码的样子。

body {
    background-image: linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    background-image: -o-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    background-image: -moz-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    background-image: -webkit-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    background-image: -ms-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%),url("images/flower-bg.jpg") repeat #eae7de;
    color:#544a46;
    font:62.5%/1.6 Helvetica, Arial, Sans-serif
    }
4

1 回答 1

0

您需要background-image:改用

试试这个代码:

background-image: url('yourimage.jpg'); /*fallback*/
background-image: url('yourimage.jpg'), linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%);
background-image: url('yourimage.jpg'), -o-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%);
background-image: url('yourimage.jpg'), -moz-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%);
background-image: url('yourimage.jpg'), -webkit-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%);
background-image: url('yourimage.jpg'), -ms-linear-gradient(bottom, rgb(255,255,255) 10%, rgb(183,176,157) 100%);
于 2013-05-31T10:50:26.990 回答