Mistalis
Mistalis

Reputation: 18289

Vertical centering <a> with glyphicon on Bootstrap 3

I'm using Twitter Bootstrap 3, and I don't have any additional CSS file. I have the following code somewhere in my HTML page:

<div class="col-md-12">
    <div class="col-md-5">
        <input type="text" class="form-control" placeholder="Task"/>
    </div>    
    <div class="col-md-5">
        <input type="textarea" class="form-control" placeholder="Descr."/>
    </div>
    <a ng-click="addTask()" class="glyphicon glyphicon-plus"></a>
</div>

It looks like this:

enter image description here

As you can see, the + is not well centered. I would like to vertical align it with my inputs. I suppose it is something simple, but I have not yet found a good solution ...

Can you help me finding how I can vertical center this <a> ?

Thanks :-)

Upvotes: 0

Views: 327

Answers (3)

Ionut Necula
Ionut Necula

Reputation: 11480

Try this:

<a ng-click="addTask()" class="glyphicon glyphicon-plus" style="display: inline-block; margin-top:15px;"></a>

Upvotes: 0

hutchonoid
hutchonoid

Reputation: 33306

You can also use vertical-align: middle;:

<a ng-click="addTask()" class="glyphicon glyphicon-plus" 
   style="vertical-align: middle;"></a>

Upvotes: 1

luk492
luk492

Reputation: 368

Add this(change the px to your liking)

<a ng-click="addTask()" class="glyphicon glyphicon-plus" style="margin-top:15px;"></a>

Upvotes: 1

Related Questions