zoukankan      html  css  js  c++  java
  • 利用input-radio和input-checkbox的表单特性可以节省很多js代码

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <style type="text/css">

    input[type=radio]{
    100px;
    height:100px;
    background: url('222.jpg') no-repeat center;
    background-size: cover;
    border:3px solid red ;
    -webkit-appearance: none
    }
    input[type=radio]:checked{
    border-color: green;
    outline: 0;

    }

    input[type=checkbox]{
    100px;
    height:100px;

    background: red;
    border:3px solid red ;
    -webkit-appearance: none
    }
    input[type=checkbox]:checked{
    background: green;
    outline: 0
    }

    </style>
    </head>
    <body>
    <input type="radio" name="aa">
    <input type="radio" name="aa">
    <input type="checkbox" name="aa">
    <input type="checkbox" name="aa">
    <input type="checkbox" name="aa">
    <input type="checkbox" name="aa">
    <script>
    </script>
    </body>
    </html>

  • 相关阅读:
    公司真题-字节跳动
    全素组探求
    枚举
    求n个整数的最大公约数
    Ajax技术
    读文本文件
    JSTL标签库
    URL跟URi的区别
    常用的JSTL标签
    EL表达语言
  • 原文地址:https://www.cnblogs.com/liuhao-web/p/8990704.html
Copyright © 2011-2022 走看看