CSS渐变与背景图像上的过滤器

时间:2014-07-17 16:43:18

标签: html css css3

我在图像上应用渐变滤镜时遇到问题。我希望渐变从黑到完全透明,从上到下,从下到上。我已经为div定义了css并使用单色(background-color),但是对于图像(background-image),它已经赢了。

我的风格定义是:

#some_id{
background: -moz-linear-gradient(top, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,0) 100%),
    -moz-linear-gradient(bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,0) 100%); /* FF3.6+ */

background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,1)), color-stop(8%,rgba(0,0,0,1)), color-stop(100%,rgba(0,0,0,0))),
    -webkit-gradient(linear, left bottom, left top, color-stop(0%,rgba(0,0,0,1)), color-stop(8%,rgba(0,0,0,1)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */

background: -webkit-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%),
    -webkit-linear-gradient(bottom, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */

background: -o-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%),
    -o-linear-gradient(bottom, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */

background: -ms-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%),
    -ms-linear-gradient(bottom, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%); /* IE10+ */

background: linear-gradient(to bottom, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%),
    linear-gradient(to top, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 8%,rgba(0,0,0,0) 100%); /* W3C */ 

background-image: url('../images/tla/tlo1.jpg');

}
你能帮助我吗?

0 个答案:

没有答案