p element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The p element represents a paragraph. A paragraph is considered to be a block of text composed of one or more sentences that refer to a particular topic, and is usually separated from others by a white space.

Authors shouldn't use the p element in situations where other more specific elements, like address or blockquote, would convey a higher meaning.

Examples

The following example shows a couple of paragraphs, one next to the other. The second paragraph is containing some other elements besides regular text.

<h1>20,000 leagues under the sea</h1>
<p>In the year 1866, ships of several nations spot a mysterious sea monster, which some suggest to be a giant narwhal. The United States government assembles an expedition in New York City to find and destroy the monster. Professor Pierre Aronnax, a French marine biologist and narrator of the story, who happens to be in New York at the time, receives a last-minute invitation to join the expedition which he accepts. Canadian master harpoonist Ned Land and Aronnax's faithful servant Conseil are also brought aboard.</p>
<p>The expedition departs Brooklyn aboard the United States Navy frigate <i>Abraham Lincoln</i> and travels south around Cape Horn into the Pacific Ocean. The ship finds the monster after a long search and then attacks the beast, which damages the ship's rudder. The three protagonists are then hurled into the water and grasp hold of the "hide" of the creature, which they find, to their surprise, to be a submarine very far ahead of its era. They are quickly captured and brought inside the vessel, where they meet its enigmatic creator and commander, Captain Nemo.</p>

20,000 leagues under the sea

In the year 1866, ships of several nations spot a mysterious sea monster, which some suggest to be a giant narwhal. The United States government assembles an expedition in New York City to find and destroy the monster. Professor Pierre Aronnax, a French marine biologist and narrator of the story, who happens to be in New York at the time, receives a last-minute invitation to join the expedition which he accepts. Canadian master harpoonist Ned Land and Aronnax's faithful servant Conseil are also brought aboard.

The expedition departs Brooklyn aboard the United States Navy frigate Abraham Lincoln and travels south around Cape Horn into the Pacific Ocean. The ship finds the monster after a long search and then attacks the beast, which damages the ship's rudder. The three protagonists are then hurled into the water and grasp hold of the "hide" of the creature, which they find, to their surprise, to be a submarine very far ahead of its era. They are quickly captured and brought inside the vessel, where they meet its enigmatic creator and commander, Captain Nemo.

In the second example, a paragraph is followed by other more specific elements (a footer and an address). The point of this example is to show the correct use of these more appropiate elements in replacement of p.

<article>
  <p>To produce a successful indoor garden requires a polished technique and a deep undertanding of these green living creatures...</p>
  <footer>&copy; 2009 Chlorophyll.com</footer>
  <address>evergreenthumbs@chlorophyll.com</address>
</article>

To produce a successful indoor garden requires a polished technique and a deep undertanding of these green living creatures...

© 2009 Chlorophyll.com
evergreenthumbs@chlorophyll.com

Attributes

Specific attributes

align

The horizontal alignment of the text inside this element and all of its descendants. There are four possible values (case-insensitive):

  • left: text is aligned to the left margin.
  • center: text is centered.
  • right: text is aligned to the right margin.
  • justify: text is justified or aligned to both margins.

The use of this attribute has become obsolete in HTML5 and, therefore, its use is no longer valid. Authors should replace it with style sheets declarations.

Example

<p align="center">The only source of knowledge is experience</p>

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.

X

Are you looking for a place to host your next website? I can help you with that!