单选按钮的修改

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
         .radio-btn + label {
        display: block;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: transparent;
        border: 1px solid black;
        cursor: pointer;
        position: relative;
        top: -11px;
        margin: 0 5px 0;
      }

      .radio-btn:checked + label::after {
        content: "\2714";
        font-size: 14px;
        line-height: 14px;
        text-align: center;
        color: #000000;
        position: absolute;
        left: 4px;
      }

      .radio-btn {
        opacity: 0;
      }
    </style>
</head>
<body>
        <div>
                <input
                  id="item1"
                  type="radio"
                  name="item1"
                  value="艺术创作个人/团体"
                  class="radio-btn"
                  v-model="picked"
                />
                <label for="item1" class="txt"></label>
              </div>
              <div>
                    <input
                      id="item"
                      type="radio"
                      name="item1"
                      value="艺术创作个人/团体"
                      class="radio-btn"
                      v-model="picked"
                    />
                    <label for="item" class="txt"></label>
                  </div>
    
</body>
</html>

以上代码的运行结果是
在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
         .radio-btn + label {
        display: block;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background:rgba(255,255,255,1);
        border:2px solid rgba(201,201,201,1);
        cursor: pointer;
        position: relative;
        top: -11px;
        margin: 0 5px 0;
      }

      .radio-btn:checked + label::after {
        content: "";
        font-size: 14px;
        line-height: 14px;
        text-align: center;
        color: #000000;
        position: absolute;
        left: 3px;
        top: 2px;
        width: 15px;
        height: 15px;
        border-radius: 50%;
        background-color: #7ECEF4;
      }

      .radio-btn {
        opacity: 0;
      }
    </style>
</head>
<body>
        <div>
                <input
                  id="item1"
                  type="radio"
                  name="item1"
                  value="艺术创作个人/团体"
                  class="radio-btn"
                  v-model="picked"
                />
                <label for="item1" class="txt"></label>
              </div>
              <div>
                    <input
                      id="item"
                      type="radio"
                      name="item1"
                      value="艺术创作个人/团体"
                      class="radio-btn"
                      v-model="picked"
                    />
                    <label for="item" class="txt"></label>
                  </div>
    
</body>
</html>

如果是这样子的话,运行结果是:在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值