html - 需要在 <textarea> <input type ="text"> 中调整 Bootstrap 图标

标签 html css twitter-bootstrap-3

我是 stackoverflow 和 bootstrap 的新手 - 请帮助我

我想在输入字段中平行调整两个相同的图标,如下图所示:

我想要的结果如下: enter image description here

注意:HTML 的结构将保持不变

.inptRelative {
    position: relative
      }

.inptAbsolute {
    position: absolute;
    right: 5px;
    top: 5px; 
  }
<div class="col-sm-6">
    <div class="form-group-sm">
      
       <label>Line of Business</label>
       <div class="inptRelative">
		   <a href="#" class="inptAbsolute glyphicon glyphicon-list"></a>
           <a href="#" class="inptAbsolute glyphicon glyphicon-list"></a>
		   <input type="text" id="myID" value="">
	   </div>  
      
	 </div>
</div>

最佳答案

请尝试此代码

.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>

你可以根据自己的需要设置宽度

关于html - 需要在 &lt;textarea&gt; &lt;input type ="text"> 中调整 Bootstrap 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35621436/

相关文章:

css - Bootstrap 3 下拉导航没有保持专注

html - Bootstrap SImple Sidebar - 下面的内容重叠

html - CSS Flex Navigation 下拉菜单的位置有点不好

css - "-webkit-text-fill-color"和 "color"之间的区别?

html - 为什么我的页脚与页面底部的内容重叠?

javascript - 在 html 表中发布 JavaScript 数组

css - Angular UI 网格 - 无法屏蔽分页控件

html - 如何通过 x 轴拉伸(stretch)表格单元格中的背景图像?

javascript - 悬停打开菜单并在光标移出时关闭

javascript - 在评论投票系统中使用一张图像加载器 gif