admin管理员组文章数量:1244271
I am trying to make an image looks like it is kind of transparent? I don't really know how to describe it but it is like you can write texts on it and the image is in the back.
is this doable with css or javascript or any other language?
I am trying to make an image looks like it is kind of transparent? I don't really know how to describe it but it is like you can write texts on it and the image is in the back.
is this doable with css or javascript or any other language?
Share Improve this question edited Jan 28, 2017 at 17:36 try-catch-finally 7,6346 gold badges49 silver badges71 bronze badges asked Jan 28, 2017 at 17:06 KatKat 1131 gold badge1 silver badge7 bronze badges 3- pretty easy in CSS Rule opacity and using a div overlaying the image – Roljhon Commented Jan 28, 2017 at 17:09
- You want it to look like it's partially transparent, or you want it to be partially transparent? – David Thomas Commented Jan 28, 2017 at 17:11
- see this link get many other effect – Md.Shahjalal Commented Jan 28, 2017 at 17:22
2 Answers
Reset to default 9I think what you need is a css filter.
For the very latest browsers check out these examples which use:
img {
-webkit-filter: brightness(20%);
filter:brightness(20%);
}
For older browsers check out these examples which use:
img {
opacity: 0.3;
filter: alpha(opacity=50); /* For IE8 and earlier */
}
You can add a mask over the image like the one below:
html:
<div>
<img scr="yourImage.jpg" alt="" />
<div class="mask"></div>
</div>
css:
.mask{
position:absolute;
width:100%;
height:100%;
background:rgba(0,0,0,0.3);
}
本文标签:
版权声明:本文标题:javascript - How to add low-key (black, transparent overlay) effect to image using CSS? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740193063a2239441.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论