learn2kode.in

HTML Paragraphs

Paragraphs in HTML are defined using the <p> tag.
They are used to display blocks of text separated by space automatically.
Browsers add some margin before and after paragraphs to make the content more readable.

Syntax

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>HTML Paragraph Example</title>
  </head>
  <body>
    <h1>HTML Paragraph Example</h1>

    <p>This is the first paragraph. It contains some sample text to demonstrate how paragraphs work in HTML.</p>

    <p>This is the second paragraph. Notice that the browser automatically adds space between paragraphs.</p>

  </body>
</html>

Output

HTML Paragraph Example

This is the first paragraph. It contains some sample text to demonstrate how paragraphs work in HTML.

This is the second paragraph. Notice that the browser automatically adds space between paragraphs.