【发布时间】:2016-04-08 03:28:32
【问题描述】:
这是我使用最新引导程序 v3 的代码
/*here is the specialjum class in css*/
.specialjum {
background: #1F72B8;
background-size: cover;
min-height: 600px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/css/bootstrap-theme.min.css" rel="stylesheet" />
<div class="jumbotron specialjum">
<div class="row">
<h6 class="text-center" style="position: relative; left: -200px;"><img src="~/Images/logo.png" /></h6>
</div>
<div class="col-lg-6 col-lg-offset-4">
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
<input type="text" class="form-control" placeholder="Search for...">
</div>
</div>
</div>
没有修改其他引导程序。 现在,当我使用上面的代码时,按钮按预期固定到输入字段,输入组在 jumbotron div 标签中居中 但是,如果我在输入文本后替换跨度按钮 按钮在右边。
这是tat的以下代码
.specialjum {
background: #1F72B8;
background-size: cover;
min-height: 600px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/css/bootstrap-theme.min.css" rel="stylesheet" />
<div class="jumbotron specialjum">
<div class="row">
<h6 class="text-center" style="position: relative; left: -200px;"><img src="~/Images/logo.png" /></h6>
</div>
<div class="col-lg-6 col-lg-offset-4">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
</div>
</div>
</div>
请注意,唯一的区别是按钮位于输入标记之前或之后的位置。
注意:Bootstrap V3 - 没有修改
请帮忙,谢谢=)
【问题讨论】:
-
看看bootstrap docs,这不是按钮的预期行为方式吗?
-
我正在查看您的代码并用它构建了一个 codepen,我认为您的代码没有任何问题。你能用油漆涂鸦一张显示你预期结果的图像吗?
-
好的,我知道了。您的输入组向右移动。
标签: html twitter-bootstrap twitter-bootstrap-3