为什么我的表单中的文本框在全尺寸屏幕上没有进一步拉伸?看起来很短!
<!-- row: 4 -->
<div class="row base-padding fill-dark">
<div class="col-md-8 no-padding">
<h2 class="white base-padding-bottom">SIGN UP FOR OUR NEWSLETTER</h3>
<p class="light-grey">Receive exclusive promotions, <strong>free passes</strong> for <strong>family and friends</strong> and links to our weekly ad!</p>
<br>
</div>
<div class="col-md-4 no-padding">
<h2 class="white base-padding-bottom">EMAIL ADDRESS</h3>
<form class="form-inline" role="form">
<div class="form-group">
<label class="sr-only" for="exampleInputEmail2">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Enter email">
</div>
<button type="submit" class="btn btn-default">Sign in</button>
</form>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
使用Bootstrap中包含的内联表单时,必须为input手动设置宽度.
默认情况下,Bootstrap中的输入,选择和textareas是100%宽.要使用内联表单,您必须在其中使用的表单控件上设置宽度.
在设置input宽度时,您似乎需要使用像素(px)值.当我尝试使用百分比值设置它时,它无法正常工作,至少在我的最后.
如果您在样式表中添加类似这样的内容,则应该能够根据需要调整文本框的大小.只需将256更改为您需要的时间.
.form-inline .form-control {
width: 256px;
}
Run Code Online (Sandbox Code Playgroud)
如果我正确理解Bootstrap文档,它不会.form-inline在较小的屏幕(<768px宽)上使用样式,所以你应该没问题.希望这可以帮助.
| 归档时间: |
|
| 查看次数: |
11130 次 |
| 最近记录: |