css3画个圆圈里的对号

效果如图

image.png

基本思路

1先画一个圆
2画两个位于圆中间的小矩形
3旋转矩形,一个左旋45度,一个右旋45度
4利用absolute进行定位。

<style>
        
    .demo2 {
        width:40px;
        height:40px;
        border-radius:40px ;
        background:black;
        display:block;
        position: relative; 
    }
    
    .demo2:before, .demo2::after {
        content:"";
        height:28px;
        width:6px;
        border-radius: 10px;
        display:block;
        background:white;
        position: absolute;
        top:6px;/*40-6=34*/
        left:20px;/*make the two rects in the middle of the cycle */
        transform:rotate(45deg);    
        -ms-transform:rotate(45deg);    
    }
    .demo2::before {
        height:15px;
        transform: rotate(-45deg);
        -ms-transform:rotate(-45deg);
        position: absolute;
        top:18px;/*40-18=12  */
        left:8px;       
    }

</style>
<span class="demo2"></span> 

总结

算像素还是挺费劲的,以后直接抄吧
去哪抄呢
CSS 3 Icons | CSS 3 Icons Generator | UIPlayGround

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容