zoukankan      html  css  js  c++  java
  • radio单选框在项目中应用

    <div class="tags-select">
        <label class="tag-select">
            <input type="radio" name="version" value="1">
            <span class="name">全网通(2GB 16GB)</span>
        </label>
        <label class="tag-select">
            <input type="radio" name="version" value="2">
            <span class="name">全网通(3GB 32GB)</span>
        </label>
        <label class="tag-select">
            <input type="radio" name="version" value="3" disabled>
            <span class="name">联通版(2GB 16GB)</span>
        </label>
    </div>
    .tags-select {
      font-size: 0;
    
      > .tag-select {
        display: inline-block;
        font-size: 14px;
        margin: 5px;
        position: relative;
        font-weight: normal;
    
        .name {
          display: block;
          line-height: 20px;
          padding: 8px 10px;
          border: 1px solid #ccc;
          cursor: pointer;
        }
    
        input[type="radio"] {
          position: absolute;
          opacity: 0;
          z-index: -1;
    
          &:checked + .name {
            border-color: #e3393c;
          }
    
          &:disabled + .name {
            background: #eee;
            color: #999;
            cursor: not-allowed;
          }
        }
      }
    }

    codepen在线示例:https://codepen.io/chendanaliyuntubiao/pen/YzqpxLO

  • 相关阅读:
    舵机驱动-GPIO MG995 STM32
    Ymodem协议-接收
    IAP注意事项
    stm32系统时钟配置,标准库v3.5
    FREERTOS移植(MDK 、STM32F103)
    C语言常量后缀
    回调函数
    运算符记忆口诀
    C语言函数指针
    frp 搭建内网穿透
  • 原文地址:https://www.cnblogs.com/hellocd/p/13557942.html
Copyright © 2011-2022 走看看