Opacity only on ul not on li css

This question already has an answer here:

  • How do I give text or an image a transparent background using CSS? 26 answers

  • Use rgba :

    .dropdown .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.8);
    }
    

    From the documentation:

    rgba()

    Colors can be defined in the Red-green-blue-alpha model (RGBa) using the rgba() functional notation. RGBa extends the RGB color model to include the alpha channel, allowing specification of the opacity of a color. a means opacity: 0=transparent; 1=opaque;

    rgba(255,0,0,0.1) /* 10% opaque red */

    rgba(255,0,0,0.4) /* 40% opaque red */

    rgba(255,0,0,0.7) /* 70% opaque red */

    rgba(255,0,0, 1) /* full opaque red */


    在你的CSS上进行以下更改

    .dropdown .dropdown-menu {
        background-color: rgba(255,255,255,0.5);
    }
    
    链接地址: http://www.djcxy.com/p/28088.html

    上一篇: 如何使背景颜色透明Div

    下一篇: 不透明只有不透明