答案 0 :(得分:1)
请尝试使用此代码
.form-horizontal .has-feedback .form-control-feedback:last-child {
right: 35px;
}
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<form class="form-horizontal">
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
<div class="form-group has-feedback">
<label class="control-label col-xs-5" for="inputSuccess2">my desired result is as following:</label>
<div class="col-xs-6">
<input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
<span class="glyphicon glyphicon-th-list form-control-feedback" aria-hidden="true"></span>
<span aria-hidden="true" class="glyphicon glyphicon-th-list form-control-feedback"></span>
</div>
</div>
</form>
您可以根据需要设置宽度
答案 1 :(得分:0)
您应该使用输入组。
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<form role = "form" style = "padding: 100px 100px 10px;">
<div class = "input-group">
<input type = "text" class =" form-control">
<span class = "input-group-addon glyphicon glyphicon-list"></span>
</div>
</form>