Reputation: 2354
I use of bootstrap in my website .When I add glyphicon glyphicon-user class to the a tags icons appear with out any space .Please advice
<a style="padding-left: 10px; padding-right: 10px; border-left-width: 10px; border-left-style: solid; margin-left: 10px;" id="dnn_dnnUser_enhancedRegisterLink" title="ثبتنام" class="glyphicon glyphicon-user" rel="nofollow" >ثبتنام</a>
Upvotes: 5
Views: 29329
Reputation: 183
Assuming the text is to the left, how about adding style="padding-left:10px" to your span?
<p>Envelope icon as a link:
<a href="#">
<span style="padding-left:10px" class="glyphicon glyphicon-envelope"></span>
</a>
</p>
Upvotes: 2
Reputation: 669
Put
between the text and icon.
Example:
<a style="padding-left: 10px; padding-right: 10px; border-left-width: 10px; border-left-style: solid; margin-left: 10px;" id="dnn_dnnUser_enhancedRegisterLink" title="ثبتنام" rel="nofollow" >
ثبتنام <span class="glyphicon glyphicon-user"></span>
</a>
A whitespace will do also
<a style="padding-left: 10px; padding-right: 10px; border-left-width: 10px; border-left-style: solid; margin-left: 10px;" id="dnn_dnnUser_enhancedRegisterLink" title="ثبتنام" rel="nofollow" >
ثبتنام <span class="glyphicon glyphicon-user"></span>
</a>
EDIT:
As your comment below that you can't add additional tags inside the a
tag, you can actually add an
or a whitespace but using your code, the icon is placed on the left not on the right as the image shows.
Using your code add an
or a whitespace before the text but the icon is on the left.
<a style="padding-left: 10px; padding-right: 10px; border-left-width: 10px; border-left-style: solid; margin-left: 10px;" id="dnn_dnnUser_enhancedRegisterLink" title="ثبتنام" class="glyphicon glyphicon-user" rel="nofollow" > ثبتنام</a>
Upvotes: 12
Reputation: 8971
Add two spans inside the anchor tag, one for holding your text, and one for the glyphicon:
<a>
<span class="glyphicon glyphicon-user" style="margin-right: 10px"></span>
<span>your text</span>
</a>
Upvotes: 0