Is there a color code for transparent in HTML?

前端 未结 9 594
抹茶落季
抹茶落季 2021-01-31 07:25

I\'m building a new website, and I\'m looking for a transparent navigation bar so the background is visible.

相关标签:
9条回答
  • 2021-01-31 07:38

    Yeah I think the best way to transparent the background colour (make opacity only for the background) is using

    .style{
            background-color: rgba(100, 100, 100, 0.5);
    }
    

    Above statement 0.5 is the opacity value.

    It only apply the opacity changes to the background colour (not all elements')

    The "opacity" attribute in the CSS will transparent all the elements in the block.

    0 讨论(0)
  • 2021-01-31 07:38

    If you are looking for android apps, you can use

    #00000000 
    
    0 讨论(0)
  • 2021-01-31 07:41

    Here, instead of making navigation bar transparent, remove any color attributes from the navigation bar to make the background visible.

    Strangely, I came across this thinking that I needed a transparent color, but all I needed is to remove the color attributes.

    .some-class{
        background-color: #fafafa; 
    }
    

    to

    .some-class{
    }
    
    0 讨论(0)
  • 2021-01-31 07:47

    When you have a 6 digit color code e.g. #ffffff, replace it with #ffffff00. Just add 2 zeros at the end to make the color transparent.

    Here is an article describing the new standard in more depth: https://css-tricks.com/8-digit-hex-codes/

    0 讨论(0)
  • 2021-01-31 07:47

    {background-color: transparent;}

    0 讨论(0)
  • 2021-01-31 07:49

    #0000ffff - that is the code that you need for transparent. I just did it and it worked.

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