html页面打水印效果

body{

position: relative;

}

body::after {

content: ""; /* 水印文字 /
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 9999;
pointer-events: none; /
允许点击穿透 */

复制代码
/* 文字样式 */
color: rgba(0, 0, 0, 0.1); /* 半透明 */
font-size: 24px;
font-weight: bold;

/* 旋转和布局 */
transform: rotate(20deg);
transform-origin: center center;
display: flex;
align-items: center;
justify-content: center;

/* 重复水印效果 */
 background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><text x="0" y="100" font-family="Arial" font-size="20" fill="rgba(0,0,0,0.1)" transform="rotate(-30)">星哥要的水印</text></svg>');

}

相关推荐
techdashen2 分钟前
Cloudflare HTML 解析器的十年演化史(二)
前端·html
ZC跨境爬虫6 分钟前
Apple官网复刻第二阶段day_1:(导航栏模块化重构+工业化可复用UI落地)
前端·javascript·css·ui·重构
天外飞雨道沧桑14 分钟前
Node.js在前端开发中扮演的角色
前端·node.js
梅梅绵绵冰17 分钟前
若依框架-智慧社区项目
前端·javascript·vue.js
IT_陈寒24 分钟前
Vite开发爽是爽,但这个动态导入坑差点让我崩溃
前端·人工智能·后端
Mr_pyx28 分钟前
CompletableFuture 使用全攻略:从异步编程到异常处理
linux·前端·python
Hello--_--World29 分钟前
React:状态管理 官网笔记
前端·笔记·react.js
花归去29 分钟前
a-table 冻结列导致边框
前端·css·css3
kuuailetianzi30 分钟前
Vue 3图片全屏预览组件:打造专业级图像浏览体验
前端·javascript·microsoft
前端杂货铺31 分钟前
manifold-3d——在 Vue 项目中实现干涉检查
前端·vue.js·manifold