CSS伪类的使用:标题下划线的纯CSS代码

在这里插入图片描述

        .title {
            color: #fff;
            font-size: 20px;
            line-height: 40px;
            height: 40px;
            text-align: center;
            position:relative;
        }

        .title:after {
            position: absolute;
            content: "";
            width: 30%;
            height: 1px;
            background: #fff;
            left: 35%;
            opacity: .4;
            bottom: 0;
        }

你可能感兴趣的:(html/css)