I am having some trouble when setting the width of BS3 input-group-addon elements that have been both prepended and appended to a text input. In this case, the width of the input-group-addon elements is set correctly, but the width of the text input no longer fills the width of the container. However if these is only one input-group-addon that has been either prepended or appended, setting the width works as expected, please see http://jsfiddle.net/asZXU/ for an example.
How do I set the width of BS3 input-group-addon elements that have been both prepended and appended to a text input and still have the text input fill the remaining width of the container?
Note: I have only set the width of the input-group-addon elements using style="width: 55px;
in the fiddle to be able to demonstrate all variations. I would ideally like to be able to set the width by doing something like:
.input-group-addon {
width: 55px;
}
Change the size of the input groups, by adding the relative form sizing classes like . input-group-lg, input-group-sm, input-group-xs to the . input-group itself.
For default size . form-control is used, for smaller size we can use . form-control class along with . form-control-sm and for larger size we can use .
input-group class is a container to enhance an input by adding an icon, text or a button in front or behind the input field as a "help text". Use . input-group-prepend to add the help text in front of the input, and . input-group-append to add it behind the input.
This looks promising: http://jsfiddle.net/panchroma/D53TE/
Have added a class to the form group with CSS
.svX3{
width:100%;
}
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With