我正在尝试使用col-sm-4类将3个字段分组为一行, 但是我对行的显示方式有疑问。如下图所示, 它显示为偏离中心且不在列内。
我的表单的代码如下:
<div class="hb-comment__form">
<h3 class="h3-header">Make a Booking</h3>
<div class="row">
[response]
<div class="col-sm-12">
[text* your-name class:input__field class:size-2 placeholder "Your Name"]
</div>
<div class="col-sm-12">
[email* your-email class:input__field class:type-2 class:size-2
placeholder "Your Email"]
</div>
<div class="col-sm-12">
[tel* telephone_number class:input__field class:type-2 class:size-2
placeholder "Your Phone Number"]
</div>
<div class="row">
<div class="contactFormPickers">
<div class="row">
<div class="col-sm-5">
<label>
Arrival Date :[date* Arrival_Date class:input__field class:type-2
class:size-2]
</label>
</div>
<div class="col-sm-5">
<label>
Depart Date: [date* Depart_Date class:input__field class:type-2
class:size-2]
</label>
</div>
<div class="col-sm-2">
<label >
Guests: <br />
[select* no_of_guests class:input__field class:type-2 class:size-2 class:guest-picker include_blank "2" "3" "4" "5" "6" "7" "8" "9" "10"]
</label>
</div>
</div>
</div>
</div>
</div>
[textarea* your-message class:input__field class:type-2 class:size-2
placeholder x5 "Your Message"] [recaptcha] [submit class:btn class:mb-0
class:btn--normal class:btn--md "Submit Booking"]
定制的CSS类” contactFormPickers”如下所示:
.contactFormPickers{
text-align:center;
margin: auto 0;
}
解决上述问题的任何帮助将不胜感激
#1
因此, 这显然是一个引导问题。你将这三个元素两次包装到.row元素中(这增加了某些边距和填充设置)-你应该至少擦除这些.row层之一。
另外, 如果你真的不需要.contactFormPickers层, 则可以考虑将其删除。
评论前必须登录!
注册