HTML <p> Tag

Description


The <p> HTML element is used for defining a paragraph. In a typical browser, one line is inserted before and after <p> ~ </p>, but if the purpose is to simply break a line, please use the <br> tag instead of the <p> tag. It is recommended to use CSS if you want to set the appearance of the document, such as adjusting the spacing between paragraphs. In CSS, you can make the width between paragraphs wider or narrower, so you can specify a finer layout. In that case, general margin properties and padding properties are used.

Properties

Permitted Parents
Any element that accepts flow content
Content
Inline and text
Start/End Tags
Start tag: optional, End tag: optional

Example

<p>This is some text in the p tag</p>
<p>This is more text using a new paragraph</p>

Attributes

Attribute Definition
align Specifies the alignment of the text within a paragraph.

Possible Values:
  • left
  • right
  • center
  • justify

Global Attributes

The <p> tag also supports the Global Attributes in HTML5

Event Attributes

The <p> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
Yes12Yes1YesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4YesYesYes

Last updated by CSSPortal on: 6th December 2019