Html 如何制作半透明背景

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18594468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 12:59:34  来源:igfitidea点击:

How to make semi-transparent background

htmlcss

提问by Agi Maulana

How to make semi-transparent background using css in element? but the content in not transparent too? sorry for bad english. Thank you.

如何在元素中使用css制作半透明背景?但内容也不透明?抱歉英语不好。谢谢你。

回答by Morrisda

use rgba background.

使用 rgba 背景。

background: rgba(0, 0, 0, 0.5);

values are in order red intensity, green intensity, blue intensity

值的顺序是红色强度,绿色强度,蓝色强度

the decimal value is the opacity, and it runs from 0 to 1.

十进制值是不透明度,它从 0 到 1。

if you need to customize it without too many difficulties, check out: css3 maker

如果您需要在没有太多困难的情况下对其进行自定义,请查看:css3 maker