What is a Paragraph in HTML?
For anyone who is new to HTML, the way paragraphs are recognized in HTML can seem a bit strange. If you have experience with text processing programs, most likely you expect that you press Enter and this is how you tell the program to put a paragraph.
However, pressing the Enter key doesn't help in HTML. Unlike in word processing programs, in a code-based HTML editor, Enter is not the end of a paragraph. When you press Enter in the HTML code, you just start typing your code/text on a new line but you are still in the same paragraph.
If you want to tell HTML to end a paragraph and start a new one, you need to use the <P> tag. The <P> tag is the way to make HTML recognize a paragraph. For instance,
<P>This is a new paragraph.</P>
displays the “This is a new paragraph." in the browser (without the quotes, of course).
As most HTML tags, the <P> tag is used for opening a paragraph and the closing tag </P> is used to mark the end of a paragraph. Though you can omit the closing </P> tag, it is recommended not to do it because in some browsers this paragraph might not display properly. Also, since most other tags require a closing paragraph, it is more consistent if you close <P> tags as well.
When your paragraphs are not properly put, this can cause a lot of issues. For instance, if you use a stylesheet to apply formatting on a paragraph-level and you don't use the <P> tag to mark the beginning of a paragraph but use other gimmicks instead, you will see that your text looks formatted in a way that you don't expect. When you apply paragraph-level formatting, it affects everything between the opening <P> tag and the closing </P> tag (or the next <P> tag, if you don't close the opening <P> tag).