Html ARGB十六进制颜色在css html中不起作用

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

ARGB Hex color not working in css html

htmlcssbackground-colorargb

提问by Obsivus

Why is this ARGB hex not working?

为什么这个 ARGB 十六进制不起作用?

<td style="background-color: #FFFF9980">

回答by Gareth

Use rgba(255,153,128,1.0)instead of your hex value (though if that really is ARGB it's the same as #ff9980in RGB- if you meant RGBA then you'll need rgba(255,255,153,0.5)).

使用rgba(255,153,128,1.0)而不是您的十六进制值(尽管如果那真的是 ARGB,它与#ff9980in相同RGB- 如果您的意思是 RGBA 那么您将需要rgba(255,255,153,0.5))。

回答by Marcus Rohrmoser

the CSS3 specsays:

CSS3规范说:

Unlike RGB values, there is no hexadecimal notation for an RGBA value.

与 RGB 值不同,RGBA 值没有十六进制表示法。

so you will have to use the rgba(255,153,128,1.0)mentioned above.

所以你将不得不使用rgba(255,153,128,1.0)上面提到的。

回答by Sanoob Pookodan

ARGB Hex color

ARGB 十六进制颜色

RGBA color values are an extension of RGB color values with an alpha channel - which specifies the opacity for a color.

RGBA 颜色值是带有 alpha 通道的 RGB 颜色值的扩展 - 指定颜色的不透明度。

An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).

RGBA 颜色值指定为: rgba(red, green, blue, alpha)。alpha 参数是一个介于 0.0(完全透明)和 1.0(完全不透明)之间的数字。

<td style="background-color: rgba(255, 0, 0, 0.2);">

#p1 {background-color:rgba(255,0,0,0.3);}
#p2 {background-color:rgba(0,255,0,0.3);}
#p3 {background-color:rgba(0,0,255,0.3);}
#p4 {background-color:rgba(192,192,192,0.3);}
#p5 {background-color:rgba(255,255,0,0.3);}
#p6 {background-color:rgba(255,0,255,0.3);}
<h1>Define Colors With RGBA Values</h1>

<p id="p1">Red</p>
<p id="p2">Green</p>
<p id="p3">Blue</p>
<p id="p4">Grey</p>
<p id="p5">Yellow</p>
<p id="p6">Cerise</p>