wavey wavey - 3 months ago 7
HTML Question

Text won't stay in the same format as written in HTML document

My HTML document has a bunch of text written down in a list like so;

example

test

this

way

Yet when the page is loaded its all one jumbled line. How do I format it so it's the way it's written above but without the spacing? Using



<p>





only creates more spacing.

Answer

You can use like breaks:

Text<br>More text<br>Even more text

These act as carriage returns and have them on separate lines. Here's an example on JSFiddle. Read more at the article on Mozilla MDN

Comments