Reputation: 139
In HTML using
for space, I get one space in the output. If my requirement needs more spaces say 100, then how to make that tag efficient? Should I type
100 times?
Upvotes: 13
Views: 134535
Reputation: 2728
 
is a character entity that denotes a non-breaking or fixed space.
It`s used to create a space that will not break into a new line by word wrap.
Provide space the same as a regular space.
Correct syntax :
(must add a semi-colon at the end) is a character entity for a non-breaking space.
You can use it either inside the container tag or just after closing the tag:
<!--Inside container tag-->
<p>Text Text</p>
<!--After closing the tag-->
<button class="btn btn-primary">Start Game</button>
<button class="btn btn-danger">End Game</button>
This will provide one space between the buttons.
Without
We can use tons of
:
for instance - <p>Text Text</p>
But we have a tag provided in HTML itself named as <pre></pre>
Using this we could have as much required space as we want between the text.
For instance:
<p>text text</p> //gives out 2 spaces.
<pre>text text</pre> //gives out the added spaces.
Upvotes: 1
Reputation: 11
you will use directly
(or)  
for needed places.
ex:
<img src="vj.jpg"> <img src="ss.jpg">
the pictures displayed in sequence with space.
Upvotes: 1
Reputation: 731
As mentioned in the comments, you should be using css for this. However, if you have to do it in html, use 'pre' tags:
<pre>hello world</pre> //prints with extra spaces in between
Upvotes: 7
Reputation: 4627
is generally used when you are intended to place a space. It is generally used when you are considering the design in terms of space a letter occupies.
If you want to vary space depending upon other factors, feel free to use padding and margin.
Upvotes: 8