ARGB Hex color not working in css html

一曲冷凌霜 提交于 2019-11-30 00:31:56

问题


Why is this ARGB hex not working?

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

回答1:


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




回答2:


the CSS3 spec says:

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

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




回答3:


ARGB Hex color

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

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).

<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>


来源:https://stackoverflow.com/questions/10815384/argb-hex-color-not-working-in-css-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!