Reputation: 39
i add icon(Bootstrap Glyphicons) in h1
but icon
not in text baseline
. how to fix This?!
Code:
<h1 ><a><i class="icon-play"></i>TEST TEXT</a></h1>
Upvotes: 3
Views: 13148
Reputation: 11
Im using Bootstrap v3.2 and I had the same problem.
<h3><span class="glyphicon glyphicon-user"></span> User</h3>
so I changed the display property of the glyphicon from inline-block to inline.
.glyphicon
{position: relative;
top: 1px;
display: inline;
...
}
This is due the An inline element has no line break before or after it, and it tolerates HTML elements next to it but an inline-block element is placed as an inline element (on the same line as adjacent content), but it behaves as a block element.
Upvotes: 1
Reputation: 2169
For Bootstrap version 3 use this.
<h1>Hi this is heading<span class="glyphicon glyphicon-star"></span> Star</h1>
See this jsfiddle.
your icon size will change according to size of its parent.
Upvotes: 8
Reputation: 180
I would try:
1) changing padding of i.icon-play
2) background-position of i.icon-play
3) vertical-align:center; line-height:12px; of i.icon-play
One of those will work, good luck ;-)
Upvotes: 0