Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap tags input width

Tags:

I am trying to use bootstrap tagsinput in a form contained in a modal like this

...
<div class="form-group">
                            <label for="myTagLabel">Tags:</label> 
                            <input class="form-control" id="myTag"  type="text" data-role="tagsinput">
                        </div>

As you can see in the image above I can't see why the input doesn't have the width of the containing form.

UPDATE this http://www.bootply.com/f43d1A0YxK reproduces the issue

enter image description here

like image 678
lowcoupling Avatar asked Aug 13 '14 20:08

lowcoupling


People also ask

How to change input size in Bootstrap?

Input Sizing in Formsinput-sm . Set the widths of elements using grid column classes like . col-lg-* and . col-sm-* .

How to create tags using Bootstrap?

Use a <select multiple /> as your input element for a tags input, to gain true multivalue support. Instead of a comma separated string, the values will be set in an array. Existing <option /> elements will automatically be set as tags. This makes it also possible to create tags containing a comma.

How do I make a small text box in bootstrap?

Use the . input-sm class to set small input field in Bootstrap.


1 Answers

The reason you are seeing this behaviour is because bootstrap-tagsinput actually hides the original input element, and in its place adds a div. You are seeing a div element styled to look like a Bootstrap input element. So any CSS to affect the original input will not produce any changes.

What you want to change is the .bootstrap-tagsinput class:

.bootstrap-tagsinput {
  width: 100% !important;
}

Here's a demo: http://www.bootply.com/1iATJfFM69

like image 92
Mohamad Avatar answered Sep 21 '22 21:09

Mohamad