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

<p align="right"> 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. </p> <p>Here is a paragraph.<br />This is the second sentence of the paragraph.<br />This is the third sentence of the paragraph.<br />Notice how each line of text is on a separate line?<br /> We used the br tag to make that happen.</p>
Output:

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.

Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com
Terms of use | Privacy policy | Copyright information | Make a donation