54

基本上我有几个输入字段,它们的跨度前面带有一些文本。当我尝试在 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>

谁能帮我让输入组插件获得相同的大小?

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

任何人都可以阐明一下吗?

4

2 回答 2

94

尝试这个

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

.input-group-addon {
    min-width:300px;// if you want width please write here //
    text-align:left;
}
于 2013-08-06T08:44:46.710 回答
16
.input-group-addon { width: 50px; } // Or whatever width you want

.input-group { width: 100%; }

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

于 2014-07-07T03:13:24.660 回答