how to add one or more space in a single line?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to add one or more space in a single line??

5th Feb 2017, 8:53 AM
masudul hasan
masudul hasan - avatar
5 Answers
+ 5
'&nbsp;' stand for 'non breakable space', and is treated by html parsers as special character... it is useful for forcing words to stay into the same line ( breaking before the words group if needed ), or adding more than one space ( as normal spaces are regrouping into once in normal parser behaviour ). However, you can specify to the html parser thant you don't want the normal behaviour for spaces by using 'white-space' css property... many keywords values are possible, among which 'pre', defining behaviour of <pre> tag: keep all spaces AND new lines character as is... Look at reference for others keywords/behaviours ;)
5th Feb 2017, 9:10 AM
visph
visph - avatar
+ 5
To add space you'll have to use &nbsp; or &#160; . There are some special characters or symbols which can't be shown by html.For those characters, we have abbreviation for each of them.For some characters we don't have abbreviations, for them we have html codes which is like &#160; . And dont forget to put ' ; ' after the code or abbreviation or it will not work. You can also use the tag <pre></pre> which is used for formatted text when we wand the browser to show the text exactly as typed. he. If u want 3 spaces between a line or if u want a sentence like: I want three spaces. Then while writing in html you'll write as: I want &nbsp;&nbsp;&nbsp three spaces.
5th Feb 2017, 9:19 AM
Ashita Gupta
Ashita Gupta - avatar
+ 2
&nbsp
5th Feb 2017, 8:54 AM
Naveen Kumar Bijjala
0
what?
5th Feb 2017, 8:56 AM
masudul hasan
masudul hasan - avatar
0
tnx Ashita Gupta
5th Feb 2017, 11:24 AM
masudul hasan
masudul hasan - avatar