CSS RGBA border / background alpha double

后端 未结 3 1195
情话喂你
情话喂你 2020-12-25 12:34

I\'m working on a website that has a lot of transparency involved, and I thought I would try to build it entirely in RGBA and then do fallbacks for IE. I need a \"facebox\"

3条回答
  •  萌比男神i
    2020-12-25 13:02

    Try this:

    #container {
        width: 700px;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.2);
        border: 10px solid rgba(255, 255, 255, 0.1);
        padding: 20px;
    
        /* and here is the fix */
        -webkit-background-clip: padding-box;
        -moz-background-clip: padding;
        background-clip: padding-box;
    }
    

提交回复
热议问题