Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting width of BS3 input-group-addon

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;
}
like image 706
rozzy Avatar asked Aug 22 '13 16:08

rozzy


People also ask

How do I change the input-group width?

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.

How do I change the width of a form-control in bootstrap?

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 .

What is input-group prepend?

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.


1 Answers

This looks promising: http://jsfiddle.net/panchroma/D53TE/

Have added a class to the form group with CSS

.svX3{
width:100%;
}  

Good luck!

like image 123
David Taiaroa Avatar answered Sep 21 '22 15:09

David Taiaroa