css 实现对号小图标。

 <div class="h"></div>

.h {
    position: relative;
    width: 80rpx;
    height: 80rpx;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 5;
}


.h::before {
    content: '';
    position: absolute;
    width: 20rpx;
    height: 30rpx;
    color: black;
    border-bottom: 1px solid;
    border-right: 1px solid;
    left: 50%;
    top: 50%;
    transform-origin: center;
    transform: translate(-50%, -30%) rotate(45deg);
    -webkit-transform: translate(-50%, -30%) rotate(45deg);
}

猜你喜欢

转载自blog.csdn.net/qq_31965515/article/details/81736203