如何在Bootstrap 3中垂直对齐标签和输入? [英] How to vertically align label and input in Bootstrap 3?

查看:173
本文介绍了如何在Bootstrap 3中垂直对齐标签和输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Bootstrap 3中垂直对齐标签和输入?我想要同一行的标签和输入。我已经玩过不同的类和自定义CSS,但没有什么似乎工作。

How to vertically align label and input in Bootstrap 3? I would like both the label and input on same line. I have played around with different classes and custom CSS but nothing seems to work.

The JSfiddle

<div class="form-group">
    <div class="row">
        <div class="col-xs-3">
            <label for="class_type"><h2><span class=" label label-primary">Class Type</span></h2></label>
        </div>
        <div class="col-xs-2">
            <select name="class_type" id="class_type" class="  form-control input-lg" style="width:200px" autocomplete="off">
                <option >Economy</option>
                <option >Premium Economy</option>
                <option >Club World</option>
                <option >First Class</option>
            </select>
        </div>
     </div>
</div>


推荐答案

c> h2 标记,默认 margin

这篇关于如何在Bootstrap 3中垂直对齐标签和输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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