• css3利用表单伪类:checked自定义单选按钮


    总结:为所有被选中的 input 元素直接兄弟元素span设置背景色:

    input:checked +span{ background-color: pink; }

    小点:点击label就会触发input控件,所以可以把label设置溢出隐藏把input藏起来,内部再设置span标签绝对定位填充

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            label{
                position: relative;
                display: inline-block;
                width: 100px;
                height: 100px;
                border: 1px solid;
                border-radius: 50% 50%;
                overflow: hidden;
            }
            label>input{
                position: absolute;
                left: -50%;
                top: -50%;
            }
            label>span{
                display: block;
                position: absolute;
                top: 0;
                right: 0;
                left: 0;
                bottom: 0;
            }
            input:checked +span{
                background-color: pink;
            }
        </style>
    </head>
    <body>
    <label><input type="radio" name="testInput"><span></span></label>
    <label><input type="radio" name="testInput"><span></span></label>
    <label><input type="radio" name="testInput"><span></span></label>
    </body>
    </html>

  • 相关阅读:
    shuffle过程分析
    自定义分组
    自定义排序及Hadoop序列化
    MapReduce常见算法
    Partitioner
    Combiner
    自定义Counter使用
    WordCount_命令行运行时指定参数
    老的API实现WordCount
    Hadoop自定义类型处理手机上网日志
  • 原文地址:https://www.cnblogs.com/threeyou/p/13460881.html
Copyright © 2020-2023  润新知