icone is not next to bootstrap input

3

I'm trying to get an icon next to my input using bootstrap, but it's always down below

My code looks like this:

<div class="row">
    <div class="col-md-12">

            <div class="form-group has-warning has-feedback">
                <label class="control-label">Nome</label>
                <input type="text" class="form-control">
                <span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
            </div>
    </div>
</div>

What am I doing wrong?

    
asked by anonymous 21.08.2014 / 01:24

3 answers

2

You're missing the div with class input-group , check out example on the official bootstrap version site 3:

<div class="input-group">
  <span class="input-group-addon">@</span>
  <input type="text" class="form-control" placeholder="Username">
</div>
    
21.08.2014 / 02:49
0

Your HTML looks correct. I even did this fiddle to demonstrate. Experiment with other column sizes, such as col-sm-12 and col-lg-12 .

Another possibility is that there are other styles in your own CSS files interfering with Bootstrap styles.

    
21.08.2014 / 04:31
0

Man, I just solved a positioning problem with the bootstrap and it was a certain class in the bootstrap css. I advise you to change the class of your bootstrap. I saw that the brand class padding had a certain value and I put it to 0. Well, what you should do, as I see it is to get the class that messes with what is inconsistent in your project and make the changes manuals corresponding to what you want.

    
25.08.2014 / 13:02