用css画一个原型里有一个对号或者叉叉的图标

7 篇文章 0 订阅
5 篇文章 0 订阅

用css画一个圆形里有一个对勾或者叉叉的图标

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用css画一个圆形里有一个对勾或者叉叉的图标</title>
    <style>
        .checkmark {
            width: 40px;
            height: 40px;
            border-radius: 40px;
            background: #009933;
            display: inline-block;
            position: relative;
        }

        .checkmark:before,
        .checkmark::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);
        }

        .checkmark::before {
            height: 15px;
            transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            position: absolute;
            top: 18px;
            /*40-18=12  */
            left: 8px;
        }

        .fork {
            width: 40px;
            height: 40px;
            border-radius: 40px;
            background: red;
            display: inline-block;
            position: relative;
        }

        .g-right {
            display: inline-block;
            width: 30px;
            height: 4px;
            background: #fff;
            line-height: 0;
            font-size: 0;
            vertical-align: middle;
            -webkit-transform: rotate(45deg);
            position: absolute;
            top: 16px;
            left: 5px;
        }

        .g-right:after {
            content: "/";
            display: block;
            width: 30px;
            height: 4px;
            background: #fff;
            -webkit-transform: rotate(-90deg);
        }
    </style>
</head>

<body>
    <div class="checkmark"></div>//对号
    <div class="fork">//叉叉
        <div class="g-right"></div>
    </div>
</body>

</html>

效果图

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值