如何使用引导程序将标签下方的复选框居中? [英] how center a checkbox underneath label using bootstrap?

查看:43
本文介绍了如何使用引导程序将标签下方的复选框居中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(以引导程序形式),该复选框显示在右侧,而标签在左侧.如何将复选框居中放置在标签下?

in a bootstrap form, the checkbox appears off to the right and the label is to the left. How to center the checkbox under the label?

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<form>
  <div class="form-row">
  <div class="form-group col-md-2">
    <label for="isNewPrice">New price?</label>
    <input type="checkbox" class="form-control" id="isNewPrice" >
  </div>
</div>
</form>

推荐答案

也许带有text-center类?

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<form>
  <div class="form-row">
  <div class="form-group col-md-2 text-center">
    <label for="isNewPrice">New price?</label>
    <input type="checkbox" class="form-control" id="isNewPrice" >
  </div>
</div>
</form>

这篇关于如何使用引导程序将标签下方的复选框居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆