<p>

A paragraph of text.

Display
block
Closing tag
Required
Permitted content
Phrasing content
On this page

Example

#
HTML
<p>HTML describes the structure of a page: what's a heading, what's a paragraph, and what's a list.</p>
<p>CSS takes care of the look, and JavaScript the behavior.</p>
Preview

Definition and usage

#

The <p> element marks a paragraph, the basic unit of text on a page. By default, the browser adds a margin above and below the paragraph equal to the height of one line.

A paragraph can only contain phrasing content: text, links, emphasis, images, and other inline elements. You can’t put a list, a table, a heading, or another paragraph inside it. If you try, the browser will close the paragraph on its own right before such an element.

The closing </p> tag can technically be omitted, but it’s always worth writing it. The code is then easier to read, and the automatic closing won’t catch you by surprise.

Syntax

#
Syntax
<p>Paragraph content.</p>

Attributes

#

This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.

Default CSS

#

Most browsers display this element with these default styles:

CSS
p {
  display: block;
  margin-block: 1em;
}

Browser support

#

Widely available

Works in all modern browsers, phones included. You can use it without worry.

  • Chrome
  • Edge
  • Firefox
  • Safari

Good practices

#
  • Don’t create spacing with empty <p></p> paragraphs or a string of <br> tags. Set spacing in CSS.
  • Short paragraphs are easier to read, especially on a phone.

Related entries

#

Spotted a mistake or missing an example? Write to us.