2

我该怎么做?我所拥有的是这些图像和这些渐变,但我只显示渐变而不是两者。

div {
    background: url(/Icons/icon.png) no-repeat;
    background-image: -moz-linear-gradient(top, #a2a2a2, #878787);
    background-image: -ms-linear-gradient(top, #a2a2a2, #878787);
    background-image: -o-linear-gradient(top, #a2a2a2, #878787);
    background-image: -webkit-linear-gradient(top, #a2a2a2, #878787);
    background-image: linear-gradient(top, #a2a2a2, #878787);
}
4

1 回答 1

1

听起来你想要多个背景图像。从逻辑上讲,渐变似乎是一种背景颜色,但浏览器将渐变信息视为背景图像。

尝试类似:

div{
    background-image: -moz-linear-gradient(top, #a2a2a2, #878787), url(/Icons/icon.png);
    background-image: -ms-linear-gradient(top, #a2a2a2, #878787), url(/Icons/icon.png);
    background-image: -o-linear-gradient(top, #a2a2a2, #878787), url(/Icons/icon.png);
    background-image: -webkit-linear-gradient(top, #a2a2a2, #878787), url(/Icons/icon.png);
    background-image: linear-gradient(top, #a2a2a2, #878787), url(/Icons/icon.png);
    background-repeat: no-repeat, no-repeat;
}
于 2012-10-25T17:32:33.993 回答