CSS 实现叉号

时间:2020-03-19 20:53:39   收藏:0   阅读:121
<div class="close"></div>
.close {
    position: relative;
    width: 40px;
    height: 40px;
}

.close::before,
.close::after {
    position: absolute;
    content: ' ';
    background-color: red;
    left: 20px;
    width: 1px;
    height: 40px;
}

.close::before {
    transform: rotate(45deg);
}

.close::after {
    transform: rotate(-45deg);
}

原文:https://www.cnblogs.com/xiaoyucoding/p/12527056.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!