HTML Paragraph Tutorials
1. HTML Paragraph
HTML paragraph or HTML p tag is used to define a paragraph in a webpage. Let's take a simple example to see how it work. It is a notable point that a browser itself add an empty line before and after a paragraph. An HTML <p> tag indicates starting of new paragraph.
2. Example :
- <p>This is first paragraph.</p>
- <p>This is second paragraph.</p>
- <p>This is third paragraph.</p>
3. Output :
This is first paragraph.
This is second paragraph.
This is third paragraph
4. Space inside HTML Paragraph
If you put a lot of spaces inside the HTML p tag, browser removes extra spaces and extra line while displaying the page. The browser counts number of spaces and lines as a single one.
5. Example :
- I am
- going to provide
- you a tutorial on HTML
- and hope that it will
- be very beneficial for you.
- Look, I put here a lot
- of spaces but I know, Browser will ignore it.
- You cannot determine the display of HTML</p>
- <p>because resized windows may create different result.
6. Output :
I am going to provide you a tutorial on HTML and hope that it will be very beneficial for you.
Look, I put here a lot of spaces but I know, Browser will ignore it.
You cannot determine the display of HTML
because resized windows may create different result.
As you can see, all the extra lines and unnecessary spaces are removed by the browser.
7. How to Use br and hr tag with paragraph?
tag is used for line break and it can be used with paragraph elements. Following is the example to show how to use
8. Example :
- <!DOCTYPE html>
- <h2> Use of line break with pragraph tag</h2>
- <p><br>Papa and mama, and baby and Dot,
- <br>Willie and me?the whole of the lot
- <br>Of us all went over in Bimberlie's sleigh,
- <br>To grandmama's house on Christmas day.
9. Output :
An HTML <hr> tag is used to apply a horizontal line between two statements or two paragraphs. Following is the example which is showing use of <hr> tag with paragraph.
10. Example :
- <!DOCTYPE html>
- <h2> Example to show a horizontal line with paragraphs</h2>
- <p> An HTML hr tag draw a horizontal line and separate two paragraphs with that line.<hr> it will start a new paragraph.
11. Output :
12. Supporting Browsers