css - 带有CSS的图像底部的渐变

标签 css image

你好我想用图像(不是背景图像)产生这种效果: enter image description here

你知道我如何用 css 创建这种效果吗?

最佳答案

看看这个:

img {
  width: 400px;
}

.content {
  background: rgba(255, 255, 255, 0) linear-gradient(to bottom, rgba(0, 0, 0, 0) 10%, rgba(255, 255, 255, .1) 40%, rgba(255, 255, 255, .5) 75%, rgba(255, 255, 255, 1) 100%) repeat scroll 0 0;
  position: relative;
  margin-top: -200px;
  height: 200px;
}
<img src="http://www.dl.21tech.ir/img-upload/2016/12/95092801.jpg" />
<div class="content"></div>

关于css - 带有CSS的图像底部的渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42694507/

相关文章:

javascript - 如何将我的文本溢出转换为列?

css - 让图像在 CSS 中 float ?

javascript - 如何从 .ashx 获取 .jpeg

html - 将图像与文本对齐,而不降低文本

c# - 在 C# 中生成一个 1x1 白色 gif 作为流

css - 如何在 moving-boxes 插件中将 .current 置于最前面

css - 如何使 Macbook 正确调整我网站上对象的大小?

javascript - Div 显示隐藏选择

javascript - html 元素沿时间轴的均匀间距

image - Matlab,如何获取imagesc生成的结果?