switch-btn

<!DOCTYPE html>
<html>
<head>
<style> 
  /*选择开关盒子*/
  .el-switch {
    display: inline-block;
    position: relative;
    font-size: 14px;
    line-height: 22px;
    height: 22px;
    vertical-align: middle
  }
  /*选择开关盒子 输入框*/
  .el-switch__input {
      display: none
  }
  /*label*/
  .el-switch__label {
    transition: .2s;
    width: 46px;
    height: 22px;
    left: 0;
    top: 0;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
  }
  .el-switch__label,.el-switch__label * {
    position: absolute;
    display: inline-block;
    font-size: 14px
  }
  .el-switch__label * {
    line-height: 1;
    top: 4px;
    color: #fff
  }
  /*长色块*/
  .el-switch__core {
    margin: 0;
    display: inline-block;
    position: relative;
/*    width: 46px;*/
    width: 58px;
    height: 22px;
    border: 1px solid #bfcbd9;
    outline: none;
    border-radius: 12px;
    box-sizing: border-box;
    background: #bfcbd9;
    cursor: pointer;
    transition: border-color .3s,background-color .3s
  }
  /* 长色块 上的按钮*/
  .el-switch__core .el-switch__button {
    top: 0;
    left: 0;
    position: absolute;
    border-radius: 100%;
    transition: transform .3s;
    width: 18px;
    height: 18px;
    background-color: #fff
  }
  /*左边的文字*/
.el-switch--wide .el-switch__label.el-switch__label--left span {
    left: 10px;
    width: 58px;
}
/*右边的文字*/
.el-switch--wide .el-switch__label.el-switch__label--right span {
    right: 10px;
    width: 58px;
}



</style>
</head>
<body>
<!-- style=" border-color: rgb(19, 206, 102); background-color: rgb(19, 206, 102);" -->
<!--  -->
  <div class="box">
    <input type="checkbox" class="switch-btn" id="J_check_box" placeholder="弹幕">
    <span></span>
  </div>
  <div class="source">
    <label class="el-switch el-tooltip el-switch--wide">


      <input type="checkbox" name=""  class="el-switch__input"> 
      <!-- 改el-switch__core颜色 和 el-switch__button 位置-->
      <span class="el-switch__core" >
      <!-- style='transform: translate(38px, 1px);' -->
        <span class="el-switch__button" ></span>
      </span>
      <!-- 文字提示 -->
      <div class="el-switch__label el-switch__label--left" style="display: none;"><!---->
        <span>弹幕</span>
      </div>
      <div class="el-switch__label el-switch__label--right" ><!---->
        <span>弹幕</span>
      </div>
    </label>
  </div>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值