css
.img1{
background: url(https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2853553659,1775735885&fm=26&gp=0.jpg);
width: 500px;
height: 351px;
}
.img2{
background: -webkit-linear-gradient(65deg, rgba(0,0,0,0), rgba(0,0,0,0), rgba(255,255,255,1)),url(https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2853553659,1775735885&fm=26&gp=0.jpg);
width: 500px;
height: 351px;
}
图片显示
<body style="background: antiquewhite;">
<img class="img1">
<img class="img2">
</body>
效果对比
完整代码
<html>
<head>
<style>
.img1{
background: url(https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2853553659,1775735885&fm=26&gp=0.jpg);
width: 500px;
height: 351px;
}
.img2{
background: -webkit-linear-gradient(65deg, rgba(0,0,0,0), rgba(0,0,0,0), rgba(255,255,255,1)),url(https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2853553659,1775735885&fm=26&gp=0.jpg);
width: 500px;
height: 351px;
}
</style>
</head>
<body style="background: antiquewhite;">
<img class="img1">
<img class="img2">
</body>
</html>