Summary
The HTML <p> element (or HTML Paragraph Element) represents a paragraph of text. Paragraphs are block-level elements.
- Content categories Flow content, palpable content.
- Permitted content Phrasing content.
- Tag omission The start tag is mandatory. The end tag may be omitted if the
<p>element is immediately followed by an<address>,<article>,<aside>,<blockquote>,<div>,<dl>,<fieldset>,<footer>,<form>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<header>,<hr>,<menu>,<nav>,<ol>,<pre>,<section>,<table>,<ul>or another<p>element, or if there is no more content in the parent element and the parent element is not an<a>element. - Permitted parent elements Any element that accepts flow content.
- DOM interface
HTMLParagraphElement
Attributes
This element includes the global attributes.
In HTML5, the align attribute on <p> is .
Example
<p>This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text.</p> <p>This is second paragraph of text. This is second paragraph of text. This is second paragraph of text. This is second paragraph of text.</p>
Above HTML will output:
This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text.
This is second paragraph of text. This is second paragraph of text. This is second paragraph of text. This is second paragraph of text.
Notes
To change gaps between paragraphs use CSS margin property. Do not insert empty paragraphs elements or <br> between them.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of '<p>' in that specification. |
Living Standard | |
| HTML5 The definition of '<p>' in that specification. |
Candidate Recommendation | |
| HTML 4.01 Specification The definition of '<p>' in that specification. |
Recommendation |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.7 or earlier) | (Yes) | (Yes) | (Yes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
See also
Document Tags and Contributors
Tags:
Contributors to this page: PablO, Sheppy, tregagnon, pablofiumara, FreakCERS, fscholz, kscarfone, osdm, hobophobe, jswisher, ethertank, teoli, iamjessklein, justleroy, shamimahsan600, Mgjbot, odraencoded, medicdude, McGurk, Bzbarsky
Last updated by:
shamimahsan600,