码迷,mamicode.com
首页 > 其他好文 > 详细

star score

时间:2015-10-31 15:44:10      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <style type="text/css" media="screen">
    /*关键点:float: right
            -webkit-appearance: none
            :checked 选择符
            同级元素选择符 ~*/
    .demo{
        float: left;
    }
    .demo input{
        float: right;
        margin: 0;
        width: 44px;
        height: 44px;
        border: 0 none;
        outline: none;
        -webkit-appearance: none; /*remove default style*/
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        background: url(a.png) 0 -44px no-repeat;
        opacity: .3;

        transition: all 100ms linear;
    }
    .demo input:hover,
    .demo input:hover ~ input{
        opacity: 1;
    }
    .demo input:checked,
    .demo input:checked ~ input{
        background-position: 0 0;
        opacity: 1;
    }
    </style>
</head>
<body>
    <div class="demo">
        <input type="radio" name="star" value="" placeholder="">
        <input type="radio" name="star" value="" placeholder="">
        <input type="radio" name="star" value="" placeholder="">
        <input type="radio" name="star" value="" placeholder="">
        <input type="radio" name="star" value="" placeholder="">
    </div>
</body>
</html>

技术分享

star score

标签:

原文地址:http://www.cnblogs.com/jiujiaoyangkang/p/4925573.html

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