水印+穿透
添加水印 实现的方法就是 广告定位+穿透(页面上的东西可操作),与页面最外层盒子并列,在最上面
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .watermark { position: fixed; width: 100%; height: 100%; pointer-events: none; z-index: 1000; background: url("./img/water.png"); background-size: 100% auto; left: 0; top: 0; } </style> </head> <body> <div id="outbox">我若成佛,天下无魔;我若成魔,佛奈我何</div> <div class="watermark"></div> <script> document.getElementById("outbox").onclick = function () { alert('穿透') } </script> </body> </html>
完美!