如何制作半透明背景? [英] How do I make a semi transparent background?
本文介绍了如何制作半透明背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使白色背景50%透明,而不影响任何其他。
I need to make a white background 50% transparent without affecting anything else. How do I do it?
推荐答案
使用 rgba()
:
.transparent{
background:rgba(255,255,255,0.5);
}
这将给你50%的不透明度,
This will give you 50% opacity while the content of the box will continue to have 100% opacity.
如果您使用 opacity:0.5
,内容将会褪色, 。因此不要使用它。
If you use opacity:0.5
, the content will be faded as well as the background. Hence do not use it.
这篇关于如何制作半透明背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文