Html 如何在中心使用完全响应的引导搜索框?

Html 如何在中心使用完全响应的引导搜索框?,html,twitter-bootstrap,css,twitter-bootstrap-3,Html,Twitter Bootstrap,Css,Twitter Bootstrap 3,我想让下面的搜索框和选择框在页面的中心,所有的字段都粘在一起。我试着用左边空白。但我认为这样做是不恰当的。请帮助我做到这一点,让所有人都在中心与响应 类别 abcd abcd abcd 每小时 abcd abcd abcd 这就是你想要的吗 类别 abcd abcd abcd 每小时 abcd abcd abcd 您可以通过应用一些引导类来实现 类别 abcd abcd abcd 每小时 abcd abcd abcd 尝试更改整个容器的类别: <div class="col-m

我想让下面的搜索框和选择框在页面的中心,所有的字段都粘在一起。我试着用左边空白。但我认为这样做是不恰当的。请帮助我做到这一点,让所有人都在中心与响应


类别
abcd
abcd
abcd
每小时
abcd
abcd
abcd

这就是你想要的吗


类别
abcd
abcd
abcd
每小时
abcd
abcd
abcd

您可以通过应用一些引导类来实现


类别
abcd
abcd
abcd
每小时
abcd
abcd
abcd

尝试更改整个容器的类别:

<div class="col-md-12 ">

我做了一个小提琴来演示如何做到这一点:

要使字段在中心浮动,而不考虑桌面或移动版本,您可以使用
col offset xx
(了解更多信息)

然后,为了使它们粘在一起,您应该使用bootstrap的
输入组
类。(更多信息)

这就是你的基础:

<form class="form-horizontal">
  <div class="col-lg-offset-3 col-lg-6">
      <div class="input-group">
         <!-- Your fields here -->
      </div>
  </div>
</form>

现在只需添加字段:

<form class="form-horizontal">
  <div class="col-lg-offset-3 col-lg-6">
    <div class="input-group">

      <select id="yourId" class="selectpicker form-control" title="Please select">
        <option>0</option>
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
      </select>

      <select id="yourId2" class="selectpicker form-control" title="Please select">
        <option>0</option>
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
      </select>

      <input type="text" class="form-control" name="snpid" placeholder="Test">

      <span class="input-group-addon">
          <i class="fa fa-search"></i>
      </span>
    </div>
  </div>
</form>

0
1.
2.
3.
4.
0
1.
2.
3.
4.
避免在这里使用元素,因为它们不能在WebKit浏览器中完全设置样式


但我也希望在桌面版中所有的都是在中心和竖直的粘在一起。明白了吗?没有。。你是说所有的东西都应该在一条线上吗?我想你应该理解
col sm-
col md-
等等。。从getbootstrap.com下载。我想所有的都是在单一的行只有在桌面版本,也没有这一切之间的差距。
<form class="form-horizontal">
  <div class="col-lg-offset-3 col-lg-6">
      <div class="input-group">
         <!-- Your fields here -->
      </div>
  </div>
</form>
<form class="form-horizontal">
  <div class="col-lg-offset-3 col-lg-6">
    <div class="input-group">

      <select id="yourId" class="selectpicker form-control" title="Please select">
        <option>0</option>
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
      </select>

      <select id="yourId2" class="selectpicker form-control" title="Please select">
        <option>0</option>
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
      </select>

      <input type="text" class="form-control" name="snpid" placeholder="Test">

      <span class="input-group-addon">
          <i class="fa fa-search"></i>
      </span>
    </div>
  </div>
</form>