What is the color code for transparency in CSS?

后端 未结 10 1695
礼貌的吻别
礼貌的吻别 2021-02-20 11:27

Can anyone tell me what is the color code for transparency in CSS like white = \"#FFFFFF\"? As I am using following code, to convert the color codes into int:

Co         


        
相关标签:
10条回答
  • 2021-02-20 12:05

    There is no hex code for transparency. For CSS, you can use either transparent or rgba(0, 0, 0, 0).

    0 讨论(0)
  • 2021-02-20 12:06

    jus add two zeroes (00) before your color code you will get the transparent of that color

    0 讨论(0)
  • 2021-02-20 12:07

    There are now 8-digit hex codes in CSS4 (CSS Color Module Level 4), the last two digit (or in case of the abbreviation, the last of the 4 digits) represents alpha, 00 meaning fully transparent and ff meaning fully opaque, 7f representing an opacity of 0.5 etc.

    The format is '#rrggbbaa' or the shorthand, '#rgba'.

    Support is lacking for MS browsers, they might be less cooperative or just slower than the other developers, either or both of which actually sealed IE's fate: https://caniuse.com/#feat=css-rrggbbaa

    0 讨论(0)
  • how to make transparent elements with css:

    CSS for IE:

    filter: alpha(opacity = 52);
    

    CSS for other browsers:

    opacity:0.52;
    
    0 讨论(0)
  • 2021-02-20 12:10

    There is no transparency component of the color hex string. There is opacity, which is a float from 0.0 to 1.0.

    0 讨论(0)
  • 2021-02-20 12:17

    try using

    background-color: none;
    

    that worked for me.

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