The HTML paragraph (<p>) element represents a paragraph of text. Paragraphs are usually represented in visual media as blocks of text that are separated from adjacent blocks by vertical blank space and/or first-line indentation. Paragraphs are block-level elements.
<p>This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text.</p> <p>This is the second paragraph. This is the second paragraph. This is the second paragraph. This is the second paragraph.</p>
HTML paragraph – the problem
The <p> element does not retain white spaces or line breaks.
<p>A steel hush freezes the trees. It is my mind stretched to stiff lace, And draped on high wide thoughts. My soul is a large sallow park And people walk on it, as they do on the park before me. They numb my levelness with dumb feet, Yet I cannot even hate them.</p>
Solution to the <p> problem- using <pre>
The <pre> tag defines preformatted text.
Text in a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks.
Solution to above problem
Trick to get rid off <pre> tag
<pre> is basically saying
. Therefore, one can use the css property
to retain white spaces in the paragraphs and bypass <pre>. For eg:
<p style="white-space:pre">s c a n f c o d e</p>