HTML p Tag

HTML<p>Tag: The HTML<p> tag specifies a paragraph. Browsers automatically add some space (margin) before and after each <p> element. The margins can be modified with CSS (with the margin properties). Most of the browsers read a line as a paragraph even if we don’t use the closing tag i.e, </p>, but this may raise unexpected results. So, it is both a good convention and we must use the closing tag.

HTML<p>Tag

HTML p tag supports both the global and the event attributes. And the paragraph tag is the block-level element.

Syntax:<p> Text </p>



Browser compatibility

The HTML<p> tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safar
  • Internet Explorer

Example:

<!DOCTYPE html>
<html>
<body>
<p>Freshersnow tutorials - Learn Tutorials
For Free. For Everyone. Forever..</p>
</body>
</html>

Output:

Freshersnow tutorials – Learn Tutorials For Free. For Everyone. Forever…

Attributes that are supported by the <p> tag

Attribute Value Description
align left
right
center
justify
Specifies the alignment of the text within a paragraph