html - 在复选框上方移动复选框标签

标签 html twitter-bootstrap

如何将复选框标签移动到复选框上方?

目前标 checkout 现在复选框的左侧,我希望它们位于复选框上方。

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
   <div class="col-md-2">
      <div class="form-group">
         <label for="viewstats">
         View Statistics
         </label>
         <input type="checkbox" value="">
      </div>
   </div>
   <div class="col-md-2">
      <div class="form-group">
         <label for="viewgraphs">
         View Graphs
         </label>
         <input type="checkbox" value="">
      </div>
   </div>
   <div class="col-md-2">
      <div class="form-group">
         <label for="viewnotifications">
         View Notifcations
         </label>
         <input type="checkbox" value="">
      </div>
   </div>
</div>

最佳答案

您的问题的答案很简单。您所要做的就是在每个结束的“label”标签之后使用一个“br”标签。换句话说,通过使用“br”或 break 标签,您告诉复选框“分解”到可用的下一行。

你的代码看起来像这样......

HTML

<div class="row">
    <div class="col-md-2">
        <div class="form-group">
            <label for="viewstats">
                View Statistics
            </label>
            <br>
            <input type="checkbox" value="">
        </div>
    </div>
    <div class="col-md-2">
        <div class="form-group">
            <label for="viewgraphs">
                View Graphs
            </label>
            <br>
            <input type="checkbox" value="">
        </div>
    </div>
    <div class="col-md-2">
        <div class="form-group">
            <label for="viewnotifications">
                View Notifcations
            </label>
            <br>
            <input type="checkbox" value="">
        </div>
    </div>
</div> 

希望对您有所帮助!

关于html - 在复选框上方移动复选框标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44327031/

相关文章:

html - Bootstrap - 无法居中 div

javascript - 使用两个按钮显示/隐藏 div

html - 对齐分层复选框

javascript - 打开列表项作为新覆盖

Javascript 全局拆分/加入或替换空格

html - 动态缩放 iFrame 内容以适应 div 宽度

javascript - Bootstrap 多级下拉菜单将子菜单固定在 DOM 上

jquery - 我怎样才能使用 bootstrap 制作一个跨越它下面其他行的列?

javascript - 更改 Bootstrap Accordion 面板的宽度(折叠元素)

javascript - jasny bootstrap offcanvas 不会在手机上滚动