Hole in overlay with CSS

前端 未结 6 954
清酒与你
清酒与你 2020-11-30 13:46

How is it possible to create a hole in an overlay where you can see through to the actual website?

6条回答
  •  没有蜡笔的小新
    2020-11-30 14:27

    No. This is not possible, not in most browsers.

    CSS Masking

    You can use masking, if you are interested only in new browsers:
    Specs: http://www.w3.org/TR/css-masking/
    Compatibility: http://caniuse.com/css-masks

    Border / Outline

    You can also use border or outline css properties if you want to create simular effect and set color of them to transparent so it looks simular.

    Position Absolute

    You can also use position:

    // top div is over child of this one

    Transparency and elements

    http://css-tricks.com/non-transparent-elements-inside-transparent-elements/
    http://css-tricks.com/examples/NonTransparentOverTransparent/
    -- this is not what are you asking for, but it can helps you :)

提交回复
热议问题