我希望glyphicon-search图标位于表单内部的最右侧,但它不在表单内部。
好吧..我们不能重写glyhicon-search类来达到目标吗?
<div class="bar navbar-inverse navbar-fixed-top">
<div class="container">
<div id="logo">
<a href="main.php">XYZ</a>
</div>
<div class="col-xs-5 right-inner-addon ">
<form class="form-inline" role="form">
<div class="form-group has-feedback">
<div class="row">
<div class="col-xs-11">
<input type="text" class="form-control" id="inputSuccess4">
<span class="glyphicon glyphicon-search form-control-feedback"></span></div></div></div>
</div>
</form>
</div>
</div>
.right-inner-addon {
padding-top: 8px;
padding-left:30px;
}
.right-inner-addon input {
height: 30px;
padding: 0px 10px;
}
.right-inner-addon i {
position: relative;
right: 0px;
padding: 10px 12px;
pointer-events: none;
}
.form-control{
min-width: 400px;
max-width: 400px;
top: 7px;
}
最佳答案
将其作为背景图像应用于输入:<input type="text" class="form-control" id="inputSuccess4">
或为icon元素提供display:block / inline-block属性。