HTML Paragraph Tag Elements:<p> Tag Tutorial

HTML Paragraph

The HTML tag <p> represents a paragraph that contains top and bottom margin.This margin is generated by default,commonly known as user agent style.

Tips:

You have to use the opening paragraph tag <p> and closing paragraph tag </p>. So that readability might be better.

Statement
<p>This is a paragraph having by default margin.</p>    

How To Eliminate By Default Margin Of The Paragraph

Tips:

Write css rule regarding paragraph tag <p> element.

Statement
 p{margin:0;}    

Creating Line Breaks

Generally <br> tag is used to create a line break of the web page.Please note that <br> tag does not have closing tag.

General Syntax

<p>Let us see html <br /> line break concept.</p>
<br />
<p>This is second line statement <br /> and it consists of line break element</p>    

Source Code

Download
<p>This is a paragraph <br>having by default margin.</p> <br>
<p>This is a another paragraph <br>having by default margin.</p>

Source Code : Output

This is a paragraph
having by default margin.


This is a another paragraph
having by default margin.

Code Explanation

The <br> tag break the paragraph and starts with a new line.

Horizontal Line

To create horizontal line within web page ,generally <hr> tag is used.It is also an empty tag that does not have a closing tag. This tag just draws a horizontal line and separates the web page contents.

General Syntax

<p>This is first Paragraph content.</p>
<hr />
<p>This is last paragraph element .</p>    

Source Code

Download
<p>This is a paragraph that supports horizonat line break.</p>
   <hr>
 <p>Another paragraph tag that has by default margin.</p>

Source Code : Output

This is a paragraph that supports horizonat line break.


Another paragraph tag that has by default margin.

Code Explanation

Horizontal Line

To create horizontal line within web page ,generally <hr> tag is used.It is also an empty tag that does not have a closing tag. This tag just draws a horizontal line and separates the web page contents.

Online Test / Quiz

Our Tutorials

Html Tutorial HTML
Css Tutorial CSS
Bootstrap 5 Tutorial BOOTSTRAP 5
Bootstrap 4 Tutorial BOOTSTRAP 4
Materialize CSS Tutorial MATERIALIZE CSS
2021-22 © shapeyourpath.com