首页 > Web开发 > 详细

css实现radio选中效果

时间:2015-03-13 16:05:09      阅读:407      评论:0      收藏:0      [点我收藏+]

html代码:

  

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>span-css模拟radio</title>
    <style type="text/css">
        #wrap{
            width: 500px;
            height: 500px;
            margin: 50px auto;
        }
        label input{
            display: none;        
        }
        label span{
            display: inline-block;
            width: 20px;
            height: 20px;
            background: url(../img/radio.png) no-repeat 0 0;
            background-position: -55px -5px;
        }
        label input:checked+span{
            background-position: -5px -5px;
        }
    </style>
</head>
<body>
    <div id="wrap">
        <label>
            <input type="radio" value="meal" name="sex">
            <span></span></label>
        <label>
            <input type="radio" value="femeal" name="sex">
            <span></span></label>        
    </div>
    
</body>
</html>

技术分享

css实现radio选中效果

原文:http://www.cnblogs.com/sdufewind/p/4335007.html

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