css怎么改变图片颜色
HTML:
<div class="pic1" style=" background-image: url('https://user-images.githubusercontent.com/8554143/34239266-232bdfc0-e641-11e7-8792-408782aaa78e.png');"></div>
CSS:
.pic1 {
background-blend-mode: lighten;
background-size: cover;
width: 200px;
height: 200px;
}
HTML标签的style加上属性:linear-gradien
HTML:
<div
class="pic1"
style="
background-image: url('https://user-images.githubusercontent.com/8554143/34239266-232bdfc0-e641-11e7-8792-408782aaa78e.png'), linear-gradient(#f00, #f00);
"
>
因为我这个网站每个客户的主题色不同,我是通过加载不同的css文件来实现的。但是这个background-image的linear-gradient属性怎么分开写,我尝试在class中写linear-gradient,在标签中只写url,但这样好像没效果
.pic1 {
background-image: linear-gradient(#f00, #f00);
background-blend-mode: lighten;
background-size: cover;
width: 200px;
height: 200px;
}