HTML Paragraph

The Paragraph is denoted by the <p> and it is block level elements it's mean it's width 100% by default and that's why browsers automatically add some white space (a margin) before and after a paragraph. Each paragraph of text in HTML document should go in between an opening <p> and a closing </p> tag.

Example : 

<!DOCTYPE html>
<html>

   <head>
      <title>Paragraph Example in HTML</title>
   </head>
	
   <body>
      <p>Here is a first paragraph.</p>
      <p>Here is a another paragraph.</p>
      <p>Here is the third paragraph</p>
   </body>
	
</html>
  Try it Yourself

Display Mechanism of HTML Paragraph

Space Inside The HTML Paragraph

if you add the extra space and extra line inside the paragraph tag then browser automatically remove the extra line and extra space and counts number of spaces and lines as a single one.

Example : 

<p>
This paragraph
contains a lot of lines
as you seen in this code
but the browser
removes it.
</p>

<p>
This paragraph
contains         a lot of white spaces 
as you seen in this         code,
but the        browser
removes it.
</p>
  Try it Yourself

HTML Line Breaks

<br> tag is used to create a new line without starting a new paragraph.

Example :

<!DOCTYPE html>  
<html>  
     <head>  
       <title>Example of HTML Line Breaks</title>
  </head>  
  <body>  
      <h2> How to  use line break with pragraph tag</h2>  
          <p>
            	This is first line<br>
            	This is second line<br>
            	This is third line<br>
            	This is fourth line
          </p>  
   </body>  
</html>
  Try it Yourself

HTML Horizontal Rules

<hr> tag is used to create a horizontal line between two statements or two paragraphs.

Example :

<!DOCTYPE html>  
<html>  
 <head>  
  <title>Example of HTML Horizontal Rules</title>
 </head>  
<body>  
 <h2> How to use HTML Horizontal Rules inside the paragraph tag.</h2>  
 <p> First Line Before Horizontal Line</p>
 <hr>
 <p>Second Line After The Horizontal Line </p>  
</body>  
</html>
  Try it Yourself