How to add image background to text with opacity?

时间:2015-09-14 15:57:40

标签: css

What I need is to add an image as a background to my text with opacity

I want it to look like this image : enter image description here

Someone knows how to do this? Thanks in advance !

2 个答案:

答案 0 :(得分:3)

您可以将文本包装在div中并将不透明度设置为小于1,这将使该div中的所有内容都是半透明的。

要仅显示文本透视,只需将颜色设置为rgba值,其中a< 1.像这样:

color: rgba(255,255,255,0.7);

这里是最后一个解决方案的小提琴:http://jsfiddle.net/fu3r0865/

答案 1 :(得分:2)

使用像这样的opacity属性。

opacity: 0.5;

不透明度的值介于0到1之间。默认值为1。

相关问题