ARGB Hex color not working in css html

前端 未结 3 1651
闹比i
闹比i 2021-01-03 21:28

Why is this ARGB hex not working?


相关标签:
3条回答
  • 2021-01-03 21:41

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

    0 讨论(0)
  • 2021-01-03 21:57

    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>

    0 讨论(0)
  • 2021-01-03 21:58

    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.

    0 讨论(0)
提交回复
热议问题