CSS RGBA border / background alpha double

后端 未结 3 1201
情话喂你
情话喂你 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条回答
  •  臣服心动
    2020-12-25 13:01

    Testing this in Firefox confirms what you describe - and it took me a little while to realize the implications of this! Having the border less transparent will have no effect on the transparent background beneath it, because the border is (as you say) additive.

    In which case, you'll have to simulate the effect you're after and work with the colours more than the alpha:

    background: rgba(128, 128, 128, 0.7);
    border: 10px solid rgba(0, 0, 0, 0.1);
    

提交回复
热议问题