How to define a paragraph in HTML 5?


How to define a paragraph in HTML 5?

The p> element in the document is used to specify a paragraph. The paragraph is defined in HTML via the p> tag. Both the opening and closing tags are present. As a result, anything put between p> and /p> is considered paragraph content. Even if we don't use the closing tag, i.e. /p>, most browsers view a line as a paragraph, leading to unexpected consequences. As a result, it is both a good convention and a requirement that we utilize the closing tag.

How to create two paragraphs in HTML 5?

Use the br element to add a space between each p element. This gives you space when you "split" the rows.

  • < p > Defines a paragraph
  • < br >Inserts a single line break
  • < pre > Defines pre-formatted text

Preserve Formatting

Sometimes, if we want your text to follow the exact format of how it is written in the HTML document, in these cases, you can use the preformatted tag < pre >.

Any text between the opening< pre > tag and the closing tag will preserve the formatting of the source document.