Bootstrap transparent navbar

后端 未结 7 1935
星月不相逢
星月不相逢 2021-02-05 15:23

I\'m trying to make the navbar transparent kinda like this. But I can\'t seem to get it to work. I\'ve added rga(0,0,0,0.5) on the navbar class.

7条回答
  •  不要未来只要你来
    2021-02-05 15:49

    First I think you have the wrong syntax for RGB or RGBA you wrote

    rga(0,0,0,0.5) 
    

    When in fact it should be

    rgba(0,0,0,0.5);
    

    Let take this for an example:

    HTML

    
    

    CSS

      .navbar {
        background: rgba(0,0,0,0.5);
      }
    

    I would also suggest to have a fallback color, just in case the browser people be using doesn't support it.

    CSS Fallback

       .navbar {
           background: rgb (0,0,0);
        }
    

提交回复
热议问题