The HTML <p> element is used to define a paragraph:
Note: Browsers will be adding some white space (a margin) before and after a paragraph automatically.
You cannot guess the way in which HTML will be displayed.
Different screen sizes such as Large or small screens, and resized windows will have different results.
Using HTML, you do not have the control to change the output by addition of extra spaces or extra lines in your HTML code.
The browser will be removing any extra spaces and extra lines that are added when the page is getting displayed:
Don't Forget the End Tag
Most browsers will be displaying HTML correctly incase if you forget to write the end tag:
The example above will be working in most browsers, but never rely on it.
Note: Not writing the end tag have the chance of producing unexpected results or errors.
HTML Line Breaks
The HTML <br> element is defined by a line break.
Use <br> incase if you want a line break (a new line), but it not needed to starting a new paragraph:
The <br> tag is called an empty tag, because it does not have an end tag.
The Poem Problem
This poem will get displayed as one line:
The HTML <pre> Element
The HTML <pre> element is used to define preformatted text.
The text inside a <pre> element will get displayed using a fixed-width font (usually Courier), and also it is known to preserve both spaces and line breaks:
HTML Tag Reference
NGO tag reference is having additional information with respect to HTML elements and their attributes.