HTML <p> (Paragraph) Tag

❮ Previous Reference Next ❯

Example

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

Meaning

The <p> block element is used to define a paragraph of text.

The <p> is a block element, browsers typically insert a blank line, but this rendering should not be assumed, given the rise of style sheets, which can use the display property to override this action.

Under the strict (X)HTML and HTML5 specifications, the align attribute is not supported. Alignment of text can instead be accomplished using CSS properties like text-align.

The closing tag for the <p> tag is optional under the HTML specification but not recommended; however, under the XHTML 1.0 specification, the closing tag <p> is required for XHTML compatibility.

Empty paragraphs are ignored by browsers.

Note: To create blank lines use the <br>element.

Version: HTML 2, 3.2, 4, 4.01, 5


Standard Syntax

<p>...</p>



Browser Support




Status







Global Attributes

<p> element also supports the Global Attributes in HTML.


Event Attributes

<p> element also supports the Event Attributes in HTML.




More Examples

Add CSS to <p> element

Example

<p  style="text-align:right">This is a paragraph.</p>
<p>This is another paragraph.</p>



How to display proper poem:

Example

<p>He who knows not, <br>
and knows not that he knows not,<br>
is a fool; shun him.<br>
<br>
He who knows not,<br>
and knows that he knows not, <br>
is a student; Teach him.<br>
<br>
He who knows,<br>
and knows not that he knows,<br>
is asleep; Wake him.<br>
<br>
He who knows,<br>
and knows that he knows,<br>
is Wise; Follow him.</p>



By Default CSS Value(s)

Most of the browsers will display the <p> element with the following by default value(s)

p {
  display: block;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
}



Related Tags:

<blockquote>, <dd>, <div>, <dl>, <dt>, <figcaption>, <figure>, <hr>, <li>, <ol>, <p>, <pre> and <ul>
❮ Previous Reference Next ❯