HTML Paragraphs

Element <p> defines paragraphs.

Browsers automatically removes extra spaces and white space within <p>

Example Paragraph



<!DOCTYPE html>
<html>
      <head>
            <title> Paragraph </title>
      </head>
      <body>
             <p>This is Paragraph. </p>
             <p>This is Paragraph.This is Paragraph.This is Paragraph.This is Paragraph.
             </p>
             <p>
             This is Paragraph. 
             This is Paragraph.
             This is Paragraph.
             This is Paragraph.
              </p>
      </body>
</html>



Browser Output


This is Paragraph.

This is Paragraph.This is Paragraph.This is Paragraph.This is Paragraph.

This is Paragraph. This is Paragraph. This is Paragraph. This is Paragraph.



HTML Line Break


Element <br> defines Line Break.

Paragraphs does not have line break without starting new paragraph for that <br> is used.

Example Line Break



<!DOCTYPE html>
<html>
      <head>
            <title> Paragraph </title>
      </head>
      <body>
           <p>
             This is Paragraph.<br>
             This is Paragraph.<br>
             This is Paragraph.<br>
             This is Paragraph.<br>
              </p>
      </body>
</html>



Browser Output


This is Paragraph.
This is Paragraph.
This is Paragraph.
This is Paragraph.



HTML <pre> Tag


<pre> element defines preformatted text

The text inside a <pre> element is displayed in a fixed width.

Example <pre>



<!DOCTYPE html>
<html>
      <head>
            <title> Paragraph </title>
      </head>
      <body>
           <pre>
             This is Paragraph.

             This is Paragraph.

             This is Paragraph.

             This is Paragraph.
              </pre>
      </body>
</html>



Browser Output


This is Paragraph. 
             
This is Paragraph.
             
This is Paragraph.
             
This is Paragraph.

Back To Top