css3实现单选

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            input{
                display: none;
            }
            label:before{
                content: '';
                display: inline-block;
                width: 3px;
                height: 3px;
                border: 1px solid red;
                border-radius: 50%;
                padding: 2px;
            }
            input:checked+label:before{
                background: red;
                background-clip: content-box;
            }
        </style>
    </head>
    <body>
        <input id="man" type="radio" name="gender" checked/>
        <label for="man"></label>
        <input id="woman" type="radio" name="gender" />
        <label for="woman"></label>
    </body>
</html>
原文地址:https://www.cnblogs.com/gxywb/p/10318189.html