css实现三角,对勾

在这里插入图片描述
在这里插入图片描述
CSS部分

<style>
        /* 外框 */

        #outSide {
            position: relative;
            width: 100px;
            height: 28px;
            border: 1px solid #999999;
            text-align: center;
            line-height: 28px;
            cursor: pointer;
        }

        /* 三角形 */

        #div6 {
            position: absolute;
            right: 0;
            bottom: 0;
            width: 0;
            height: 0;
            border: 11px solid #CCCCCC;
            border-left: 11px solid transparent;
            border-top: 11px solid transparent;
        }

        /* 对号 */

        .check {
            position: relative;
            display: inline-block;
            width: 25px;
            height: 25px;
            border-radius: 25px;
        }

        .check::after {
            content: "";
            position: absolute;
            left: -2px;
            top: 0px;
            width: 40%;
            height: 22%;
            border: 2px solid #fff;
            border-radius: 1px;
            border-top: none;
            border-right: none;
            background: transparent;
            transform: rotate(-45deg);
        }
    </style>


HTML部分

<div id="outSide" onclick="handleBackground()">
        &yen;100,000
        <div id="div6">
            <span class="check"></span>
        </div>
    </div>

JS部分

 <script>

        function handleBackground() {
            document.getElementById('outSide').style.cssText = "border: 1px solid #3888FF;"
            document.getElementById('div6').style.cssText = "border: 11px solid #3888FF; border-left: 11px solid transparent; border-top: 11px solid transparent;"
        }

    </script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值