首页 > 其他 > 详细

自定义单选按钮

时间:2019-11-18 16:17:30      阅读:84      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
            label{
                position: relative;
                float: left;
                width: 100px;
                height: 100px;
                border: 2px solid;
                overflow: hidden;
                /*变成圆形*/
                border-radius: 50%;
            }
            label > span{
                position: absolute;
                left: 0;
                top: 0;
                bottom: 0;
                right: 0;
            }
            input{
                position: absolute;
                top: -50px;
                left: -50px;
            }
            input:checked +span{
                background-color: palevioletred;
            }
            
        </style>
    </head>
    <body>
        <label >
            <input type="radio" name="button" />
            <span></span>
        </label>
         <label >
            <input type="radio" name="button" />
            <span></span>
        </label>
         <label >
            <input type="radio" name="button" />
            <span></span>
        </label>
        
    </body>
</html>

技术分享图片

 

自定义单选按钮

原文:https://www.cnblogs.com/xuanxuanya/p/11882801.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!