Check & radio的样式

Check & radio

同样的,很多相同重复的地方,不再会重新提及,会挑选有趣的地方来学习和分享

Switches

uses the .form-switch class to render(变成) a toggle switch.

  • 在div上add class.form-check .form-switch

  • input using role="switch"让推拉switch效果生效

<div class="form-check form-switch">
  <input class="form-check-input" type="checkbox" role="switch" id="1">
  <label class="form-check-label" for="1">
  Default switch checkbox input
  </label>
</div>

Inline

Group checkboxes or radios on the same horizontal row by adding .form-check-inline to any .form-check.

往任意class为form-check的标签添加 .form-check-inline将使这组checkboxes 或者 radio 放在同一水平行中

  • 在div上添加classes:form-check form-check-inline

<div class="form-check form-check-inline">
  <input class="form-check-input" type="checkbox" 
  id="inlineCheckbox1" value="option1">
  <label class="form-check-label" for="inlineCheckbox1">1</label>
</div>

<div class="form-check form-check-inline">
  <input class="form-check-input" type="checkbox" 
  id="inlineCheckbox2" value="option2">
  <label class="form-check-label" for="inlineCheckbox2">2</label>
</div>

Reverse

Put your checkboxes, radios, and switches on the opposite(相反的) side with the .form-check-reverse modifier(修改) class.

  • 在div上添加classes:form-check form-check-reverse

<div class="form-check form-switch form-check-reverse">
  <input class="form-check-input" type="checkbox" id="switchReverse">
  
  <label class="form-check-label" for="switchReverse">
  Reverse switch checkbox input
  </label>
</div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值