把下面的代码添加到你需要的位置。
<!--水印开始-->
<canvas id="myCanvas" width="100%" height="100%" style="border:0px solid #dcdcdc;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
var can = document.createElement('canvas');
var body = document.body;
body.appendChild(can);
can.width=400;
can.height=200;
can.style.display='none';
var cans = can.getContext('2d');
//ctx.translate(-60, 0);//移动坐标原点
cans.rotate(-20*Math.PI/180);
cans.font = "16px Microsoft JhengHei";
cans.fillText("kk.01j.top",can.width/3,can.height/2);
body.style.backgroundImage="url("+can.toDataURL("image/png")+")";
</script>
<!--水印结束-->效果展示

渝公网安备50022202000470
渝ICP备2023013153号-1 Powered by qibosoft X1.0 Code ©2003-2020