Is there a color code for transparent in HTML?

前端 未结 9 574
抹茶落季
抹茶落季 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.

提交回复
热议问题