Bootstrap Glyphicon搜索按钮大小

时间:2015-10-02 05:38:33

标签: html twitter-bootstrap

您好我无法调整搜索按钮的大小,以使其与文本字段的高度相同。提前谢谢!。



<div class="form-group col-md-4">
  <div class="col-md-9">
    <label for="search">Search:</label>
    <div class="input-group">
      <input type="text" class="input-sm form-control" id="search" />
      <span class="input-group-addon">
           <button type="submit" class="btn btn-default btn-xs">
		   <span class="glyphicon glyphicon-search"></span>
      </button>
      </span>
    </div>
  </div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

您可以使用Input Group代替输入组插件,并更改按钮以匹配小的输入大小。请参阅示例代码段。

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<hr>
<div class="form-group col-md-4">
  <div class="col-md-9">
    <label for="search">Search:</label>
    <div class="input-group">
      <input type="text" class="input-sm form-control" id="search" /> <span class="input-group-btn">
        <button type="submit" class="btn btn-default btn-sm" type="button"><span class="glyphicon glyphicon-search"></span>

      </button>
      </span>
    </div>
  </div>
</div>
<!-- /input-group -->