简体   繁体   English

按钮插件中的Bootstrap Glyphicon

[英]Bootstrap glyphicon in button addons

Glyphicons in Bootstrap button addons cause the button to shrink so it doesn't fit the input properly. Bootstrap按钮插件中的Glyphicons导致按钮缩小,因此无法正确地适应输入。 Standard text doesn't have this problem. 标准文字没有这个问题。

Is there a way to do this? 有没有办法做到这一点? Here's an example: 这是一个例子:

<div class="input-group">
  <input type="text" class="form-control">
  <span class="input-group-btn">
    <button class="btn btn-default" type="button">
      <span class="glyphicon glyphicon-calendar"></span>
    </button>
  </span>
</div>

But changing the button to something like the following works fine. 但是将button更改为如下所示即可正常工作。

<button class="btn btn-default" type="button">XXX</button>

This answer suggests the font size is inherited from the parent element but I don't think that applies here as it works fine with text, and changing the font-size rule doesn't help. 该答案表明字体大小是从父元素继承的,但是我认为这不适用于此处,因为它可以很好地处理文本,并且更改字体大小规则无济于事。

 <div class="input-group">
        <input type="text" class="form-control">  
        <span class="input-group-addon">    
            <i class="glyphicon glyphicon-calendar"></i>
        </span>     
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM