HTML Paragraph


January 11, 2022, Learn eTutorial
1374

In this HTML tutorial, you will learn all about the Paragraph Tag in HTML. We will also discuss the line break tag and the horizontal rule tag in HTML.

What is the use of the Paragraph tag in HTML?

A paragraph in a webpage is defined by the HTML paragraph or HTML p tag. To demonstrate how it works, let's look at a basic example. It's worth noting that a browser will automatically insert an empty line before and after a paragraph. The <p> tag in HTML denotes the start of a new paragraph.


<p>This is first paragraph.</p>  
<p>This is second paragraph.</p>  
<p>This is third paragraph.</p>
 
HTML P tag

Using the <br> tag in HTML

Line breaks are made via the HTML <br> tag, which may be used with paragraph components. The following is an example of how to utilize the <br> element with the element.


<p>This is first paragraph. <br>  
This is second paragraph. <br>
This is third paragraph. </p>  
 
HTML P tag

Using the <hr> tag in HTML

A horizontal line is drawn between two statements or paragraphs using the HTML <hr> element. The following is an example of how to use the <hr> tag with a paragraph.


<p>This is first paragraph.</p><hr>  
<p>This is second paragraph.</p><hr>
<p>This is third paragraph.</p> 
 
HTML br tag

White space in the HTML Paragraph

By pressing the space bar or tab key on the keyboard, the browser will normally show the numerous spaces made inside the HTML code as a single space. Multiple line breaks made by using the enter key inside the HTML code are likewise shown as a single space.


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

This             is third paragraph.</p>
 
HTML P tag

Using the Preformatted Text

Using  , <br>, and other spacing management tools aren't always practical. You can also use the <pre> tag to show spaces, tabs, line breaks, and other elements precisely as they appear in the HTML file. It's very useful when presenting content that requires a lot of white space and line breaks, such as poetry or code.


<pre>This is first             paragraph.
This is second paragraph.

This             is third paragraph.</pre>  
 
HTML Pre tag