0
点赞
收藏
分享

微信扫一扫

html css radio单选按钮样式

颜路在路上 2022-02-22 阅读 69

 

<!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></title>
    <style>
        .radio_type {
            width: 30px;
            height: 30px;
            /*appearance: none;*/
            position: relative;
            outline: none;
        }
        .radio_type:before {
            content: "";
            width: 28px;
            height: 28px;
            border: 1px solid #41BEAE;
            display: inline-block;
            border-radius: 50%;
            vertical-align: middle;
            background: white;
        }
        .radio_type:checked:after {
            content: "";
            width: 22px;
            height: 21px;
            text-align: center;
            background: #41BEAE;
            border-radius: 50%;
            display: block;
            position: absolute;
            top: 4px;
            left: 4px;
        }
    </style>
</head>

<body>
<label> <input class="radio_type" name="my" type="radio"/>选项1</label>
<label> <input class="radio_type" name="my" type="radio"/>选项2</label>
<label> <input class="radio_type" name="my" type="radio"/>选项3</label>

</body>

</html>
举报

相关推荐

0 条评论