twitter bootstrap 3 input-group-addon not all the same size

CssTwitter Bootstrap

Css Problem Overview


Basically I have a couple of input fields which have a span prepended with some text. When I try to set col-lg-4 and col-lg-8 on the input-group-addon and the input field itself, it doesn't do what I expected it to do and resize them.

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

Can anyone help me getting the input-group-addon get the same size?

I've created a fiddle here: http://jsfiddle.net/Dzhz4/ that explains my problem.

Anyone that can shed some light please?

Css Solutions


Solution 1 - Css

try this

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

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

Solution 2 - Css

.input-group-addon { width: 50px; } // Or whatever width you want

.input-group { width: 100%; }

The first part sets the width of your addons, the second forces the inputs to take up all of their parent container.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJ.PipView Question on Stackoverflow
Solution 1 - CssFalguni PanchalView Answer on Stackoverflow
Solution 2 - CssrictionaryFeverView Answer on Stackoverflow