Code前端首页关于Code前端联系我们

CSS3伪元素构造文章水印背景代码及效果

terry 2年前 (2023-09-27) 阅读数 65 #数据结构与算法
h1 {
    position: relative;
    margin: 0;
    font-weight: bold;
    letter-spacing: -0.05rem;
    line-height: 1;
    text-transform: uppercase;
    z-index: 10;
}
h1:before {
    content: "2018/08";
    font-family: monospace;
    font-size: 10rem;
    position: absolute;
    top: 2rem;
    left: -2rem;
    z-index: 0;
    line-height: 1;
    color: rgba(50, 25, 0, 0.1);
}
复制代码

效果:

CSS3 伪元素构建文章水印背景代码及效果

作者:codercao
链接:https://juejin.im/post/5b6d0c5cf265da0f504a837f版权所有:Ns to 作者 大家。如需商业转载,请联系作者以获得批准。非商业转载请注明来源。

版权声明

本文仅代表作者观点,不代表Code前端网立场。
本文系作者Code前端网发表,如需转载,请注明页面地址。

热门