<div class="image-container"> <img src="your-image.jpg" alt="翻滚的胖子博客"> </div>
.image-container { position: relative; width: 300px; height: 200px; }
.image-container:before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%); }
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(0,0,0,0.8) 100%);
本文为翻滚的胖子原创文章,转载无需和我联系,但请注明来自猿教程iskeys.com