HTML Paragraphs

HTML Paragraphs are defined with the <p> tag. A text between <p> and </p> tags is called <p> element or Paragraph Element.

<p>This is a paragraph</p>

In HTML, The <p> element is the most commonly used for building blocks of the content. Browsers automatically create some space above and below the content. The space is applied by the Browser’s built-in style sheets like ─

Browser’s built-in style sheets for Paragraph Element

But you can override this default style using your own CSS.

Don’t Forget to Use Closing Tag

Most Browsers will display it correctly even if you forget to use End tag</p>. But in XHTML, skipping End tag would not be acceptable and validated. So, don’t skip closing tag like ─

<p>This is a paragraph content
<p>This is a another paragraph content

HTML Line Breaks

The HTML <br> tag defines a line break. You cannot separate a new line without using this tag like ─

Example Try this Code
<p>This is a paragraph
without line break.</p>

So to produce a line break, use <br> tag inside the content. Each tag inserts a single line break.

Example Try this Code
<p>This is a paragraph <br> with a line break <br> and with another line break.</p>

Use Extra Spaces in HTML

Browsers take only one space and remove extra spaces in HTML. So you cannot increase spaces only using Keyboard Space bar inside the content like ─

Example Try this Code
<p>This paragraph contains           a lot of spaces
but the browser ignores it.</p>

But you can produce extra spaces using this non-breaking space: &nbsp;. It means It will produce a space without breaking into a new line.

Example Try this Code
<p>This paragraph contains &nbsp;&nbsp;&nbsp;&nbsp;a lot of spaces.</p>
Note: Every space is considered as one character.