Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to use multiple   in html?

I have a situation where I want to space out the elements in html using more than one space. Is there any way other than using multiple   ?

HTML:

<td width="10%">
    <a href=""><i class="glyphicon glyphicon-envelope"></i></a>View&nbsp;&nbsp;&nbsp;
    <a href=""><i class="glyphicon glyphicon-link"></i></a>Append&nbsp;&nbsp;&nbsp;
    <a href=""><i class="glyphicon glyphicon-trash"></i></a>Delete
</td>
like image 883
Vipul Agarwal Avatar asked Aug 06 '15 12:08

Vipul Agarwal


2 Answers

I figured it out myself: This can be achieved by the following depending on how much space you want:

&nbsp;    - single space
&thinsp;  - thin space
&ensp;    - en space(half the point size of the font)
&emsp;    - em space(point size of the font)

Reference: http://www.w3.org/MarkUp/html3/specialchars.html

This is what I have done:

<td width="10%">
    <a href=""><i class="glyphicon glyphicon-envelope"></i></a>View&thinsp;
    <a href=""><i class="glyphicon glyphicon-link"></i></a>Append&thinsp;
    <a href=""><i class="glyphicon glyphicon-trash"></i></a>Delete
</td>

Hope this helps out.

like image 156
Vipul Agarwal Avatar answered Oct 10 '22 22:10

Vipul Agarwal


Using CSS to change the margin or padding to space out your elements is generally the accepted answer.

You could also go nuts and use position: absolute or postion: relative and space the elements out by playing with the top and left properties.

like image 40
TheIronCheek Avatar answered Oct 10 '22 23:10

TheIronCheek