How can you make an iframe have pointer-events: none; but not on a div inside that?

前端 未结 5 1842
误落风尘
误落风尘 2021-01-01 10:22

I have an iframe with an inherited pointer-events: none; but when I have inserted a

inside the iframe with a pointer-events: auto
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-01 10:43

    Don't give the whole iframe pointer-events: none. Just inside the iframe put a CSS rule body * { pointer-events: none;}

    This way the iframe does not block events, however elements inside the iframe are not clickable.

提交回复
热议问题