HTML <p> tag
The <p> tag is used to display a paragraph.
NOTE: Most browsers will automatically places a line break above and below the paragraph text.
Attributes
| Attribute | Description | Possible values |
|---|---|---|
| align | Deprecated. Sets how the paragraph text will be aligned | left, center, right, justify |
Standard attributes
class, dir, id, lang, style, title, xml:lang
For more information on standard attributes, check out our HTML standard attributes reference page.
Event attributes
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
For more information on event attributes, check out our HTML event attributes reference page.
Example
When you are typing a document in a word processing program (such as an essay or a novel), the document should have a certain format. The same concept applies to content on the web. You can't just have a huge block of text going down your page, you need to organize that text into paragraphs.
Here is a paragraph.
This is the second sentence of the paragraph.
This is the third sentence of the paragraph.
Notice how each line of text is on a separate line?
We used the br tag to make that happen.
Tips & notes
Use the <br /> tag to break up a paragraph into several lines of text.
Use CSS text properties to set unique styles for paragraphs such as background color, text size, text font-type, borders, and more.