gpt4 book ai didi

html - 如何居中内联表单 bootstrap 3

转载 作者:太空狗 更新时间:2023-10-29 15:22:08 24 4
gpt4 key购买 nike

我正在尝试制作一个包含多个选项的搜索栏并希望将其居中

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

<div id="search_panel">
<div class='container'>
<form class="form-inline" role="form">
<!-- SEARCH PLACE -->
<div class="form-group">
<label class="sr-only" for="inputEmail">search</label>
<input id="where" name="where" type="search" placeholder="where you want to visit ...." class="form-control input-md" required="">
</div>
<!-- CHECK-IN DATE -->
<div class="form-group" id="start">
<i class="fa fa-calendar fa-2x"></i>
<input type='text' placeholder="Check-In Date" class="form-control" id='datepicker-start' />
</div>
<div class="form-group" id="end">
<i class="fa fa-calendar fa-2x"></i>
<input type='text' placeholder="Check-Out Date" class="form-control" id='datepicker-end' />
</div>
<!-- Button Drop Down -->
<div class="form-group">
<label class="sr-only" for="inputEmail">Select Basic</label>
<select id="selectbasic" name="selectbasic" class="form-control">
<option value="1">Option one</option>
<option value="2">Option two</option>
</select>
</div>
</form>
</div>
</div>

最佳答案

你也可以合并类

如果你改变你的定义

<form class="form-inline" role="form">

<form class="form-inline text-center" role="form">它应该有效!

我想在添加额外样式之前尽可能多地保留普通 Bootstrap

bootstrap 带有本地对齐类,可以在这里找到:http://getbootstrap.com/css/#type-alignment

HTH

关于html - 如何居中内联表单 bootstrap 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26102910/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com