How to give cross browser transparency to element's background only?

前端 未结 1 1938
Happy的楠姐
Happy的楠姐 2021-01-16 15:02

How to give cross browser transparency to background only?

I want to give transparency to background of ul { background: } only don\'t want to make te

1条回答
  •  [愿得一人]
    2021-01-16 15:21

    you can use RGBA colors. I have made up an example for you:

    http://jsfiddle.net/ypaTH/

    ul {
     background: rgba(255, 255, 255, 0.5) //white with opcaity of 50%
    }
    
    ul li {
     color: #fff;
     background: rgba(0, 0, 0, 0.5) //black with opcaity of 50%
    }
    

    here is a workaround for IE and the compatibly list: http://css-tricks.com/rgba-browser-support/

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