【问题标题】:twitter bootstrap 3 input-group-addon not all the same sizetwitter bootstrap 3 input-group-addon 大小不一样
【发布时间】:2013-08-07 04:21:30
【问题描述】:

基本上,我有几个输入字段,它们的跨度前面带有一些文本。当我尝试在 input-group-addon 和输入字段本身上设置 col-lg-4 和 col-lg-8 时,它并没有按照我的预期去做并调整它们的大小。

<div class="input-group">
   <span class="input-group-addon">some text</span>
   <input type="text" class="form-control" id="current_pwd" name="current_pwd" />
</div>

谁能帮我让 input-group-addon 的大小相同?

我在这里创建了一个小提琴:http://jsfiddle.net/Dzhz4/,它解释了我的问题。

有大神能介绍一下吗?

【问题讨论】:

    标签: css twitter-bootstrap


    【解决方案1】:
    .input-group-addon { width: 50px; } // Or whatever width you want
    
    .input-group { width: 100%; }
    

    第一部分设置插件的宽度,第二部分强制输入占用所有父容器。

    【讨论】:

      【解决方案2】:

      试试这个

      http://jsfiddle.net/Dzhz4/1/

      .input-group-addon {
          min-width:300px;// if you want width please write here //
          text-align:left;
      }
      

      【讨论】:

      • 这是唯一对我有用的东西。但它不适用于百分比:(
      猜你喜欢
      • 1970-01-01
      • 2013-08-07
      • 1970-01-01
      • 2017-11-09
      • 1970-01-01
      • 1970-01-01
      • 2013-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多