html test page

 | 

Paragraphs in HTML are used to display text elements on a web page. In HTML paragraphs are defined using <p> tag.

Paragraphs in HTML

HTML paragraphs are defined using <p> tag. The text enclosed in between <p> and </p> acts as a paragraph.

Most browsers recognize a line as a paragraph even if we forget using the closing </p> tag as the earlier versions of the HTML used to support it.

Sample Code

[code]
  • Java
  • Ruby
  • Perl
[/code]
<ul>
    <li>Java</li>
    <li>Ruby</li>
    <li>Perl</li>
</ul>

Output

This is a paragraph.

This is another paragraph.

From the above example you could notice that by default a line space is added before and after a paragraph. This is achieved by the browser by setting up the top and bottom margins automatically for every paragraph.

Comments