Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

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.

See this example:

  1. <p>This is first paragraph.</p>
  2. <p>This is second paragraph.</p>
  3. <p>This is third paragraph.</p>

Test it Now

Output:

This is first paragraph.

This is second paragraph.

This is third paragraph.


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.

  1. <p>
  2. I am
  3. going to provide
  4. you a tutorial on HTML
  5. and hope that it will
  6. be very beneficial for you.
  7. </p>
  8. <p>
  9. Look, I put here a lot
  10. of spaces                    but            I know, Browser will ignore it.
  11. </p>
  12. <p>
  13. You cannot determine the display of HTML</p>
  14. <p>because resized windows may create different result.
  15. </p>

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.


Supporting Browsers

Element chrome_browser Chrome ie_browser IE firefox_browser Firefox opera_browser Opera safari_browser Safari
<p> Yes Yes Yes Yes Yes

Comments

comments