HTML/CSS: Make a div “invisible” to clicks?

后端 未结 5 1034
清歌不尽
清歌不尽 2020-11-28 06:37

For various reasons, I need to put a (mostly) transparent

over some text. However, this means that the text can\'t be clicked (eg, to click links or
5条回答
  •  一整个雨季
    2020-11-28 07:04

    It can be done using CSS pointer-events. This property is supported in Firefox 3.6+, Chrome 2+, IE 11+, and Safari 4+. Unfortunately, I don't have knowledge of a cross-browser workaround.

    #overlay {
      pointer-events: none;
    }
    

提交回复
热议问题