CSS 创建一个白色的 rgba / CSS3

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8287447/
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-30 02:14:43  来源:igfitidea点击:

create a white rgba / CSS3

css

提问by doc holiday

I'm customizing a plugin that uses css3's rgba throughout, I'm trying to figure out how to toggle it for it to render white with the opacity. At default it's near the shade of #333, and my attempts area leading it to blue or brown. Whats the white customization numbers? below is what I'm using?

我正在自定义一个在整个过程中使用 css3 的 rgba 的插件,我试图弄清楚如何切换它以使其具有不透明度呈现白色。默认情况下,它靠近 的阴影#333,我的尝试区域导致它变成蓝色或棕色。白色的定制编号是多少?下面是我正在使用的?

background:rgba(255,255,255, 0.3);

回答by bookcasey

The code you have is a white with low opacity.

您拥有的代码是低不透明度的白色。

If something white with a low opacity is above something black, you end up with a lighter shade of gray. Above red? Lighter red, etc. That is how opacity works.

如果具有低不透明度的白色物体高于黑色物体,您最终会得到较浅的灰色阴影。红色之上?较浅的红色等。这就是不透明度的工作原理。

Here is a simple demo.

这是一个简单的演示

If you want it to look 'more white', make it less opaque:

如果你想让它看起来“更白”,让它不那么不透明:

background:rgba(255,255,255, 0.9);

background:rgba(255,255,255, 0.9);

Demo

演示

回答by ?ime Vidas

I believe

我相信

rgba( 0, 0, 0, 0.8 )

is equivalent in shade with #333.

在阴影中与 等效#333

Live demo:http://jsfiddle.net/8MVC5/1/

现场演示:http : //jsfiddle.net/8MVC5/1/

回答by Stefanni Becker

For completely transparent color, use:

对于完全透明的颜色,请使用:

rbga(255,255,255,0)

A little more visible:

更明显一点:

rbga(255,255,255,.3)