码迷,mamicode.com
首页 > Web开发 > 详细

CSS3自定义单选按钮

时间:2019-01-12 14:14:44      阅读:410      评论:0      收藏:0      [点我收藏+]

标签:otto   单选   order   css   inpu   top   nbsp   radius   utf-8   

<!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;
                left: -50px;
                top: -50px;
            }
            
            
            input:checked + span{
                background: pink;
            }
        </style>
    </head>
    <body>
        <label >
            <input type="radio" name="atguigu" />
            <span></span>
        </label>
        <label >
            <input type="radio" name="atguigu" />
            <span></span>
        </label>
        <label >
            <input type="radio" name="atguigu" />
            <span></span>
        </label>
    </body>
</html>

 

CSS3自定义单选按钮

标签:otto   单选   order   css   inpu   top   nbsp   radius   utf-8   

原文地址:https://www.cnblogs.com/panlaixing/p/10259353.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!