Skip to content
techsnow

HTML Basic Tags

Paragraph Tag

The <p> tag defines a paragraph: a block of text.

Syntax:

<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>

Browsers automatically add some space (margin) above and below each paragraph, so they are visually separated.

Whitespace is collapsed

Extra spaces and new lines inside your code are ignored. The browser collapses them into a single space and wraps the text to fit the screen.

<p>
  This     text has
  many      spaces and
  line breaks.
</p>

Output

This text has many spaces and line breaks.

If you need a real line break, use <br>. If you need to keep spacing exactly, use <pre>. Both are covered in this section.