'Number of spaces in HTML

Please tell me how to put more than one space in HTML ?

For one space,we write  , so for 5 spaces, we have to write   five times...

Is there any alternative way? or any tag ?



Solution 1:[1]

You could use something like <span style="margin-left: 20px;"></span> to create some sort of 20px space between two words. Other than that, no.

Solution 2:[2]

You can use the

<pre>a    text    with        multiple spaces</pre>

tag :)

Solution 3:[3]

As far as I know, if you are not using CSS then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is the only way. Now days using CSS and Adding a Spacer Span would be more advised. All the best.

Solution 4:[4]

The simplest way I have used is to add <span style="color:white;">(anything here)</span> The bit in the span can be as long or as short as you like- it's not seen. The color of course is the color of the page/section where you place it. I prefer XXXXXXX as X is standard width (unlike M and I) and it's easy to see how many Xs you will need for a given space.

Solution 5:[5]

To actually insert spaces you are stuck with &nbsp; , the other common thing for spacing things out is to use 1x1 pixel gif and set the images with in the IMG tag.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 goto-bus-stop
Solution 2 Alexandre Bourdin
Solution 3 scunliffe
Solution 4
Solution 5 troutinator