p tag (XHTML 1.1)

paragraph

Topics

The p, short for paragraph, tag does exactly what the name implies: It creates a paragraph of text, and should be used when displalying substantial amounts of text on a webpage. The amount of space between paragraphs is up to the browser, but it seems to be some what standardized. Here is an example:

<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>

The result simply looks like this:

 

This is the first paragraph.

 

This is the second paragraph.

The align attribute

The align attribute allows you to specify how the text within the paragraph should be aligned. You can click on the link to see the possible values. Here's an example where we have aligned the text to the right:

 

Text aligned to the right!

 

However, the align attribute has been deprecated. You can achieve the exact same effect with CSS though, using the text-align property.

Attributes

Attribute Deprecated Required Description
alignX align, text alignment 
class  space-separated list of classes 
dir  direction for weak/neutral text 
id  document-wide unique id 
lang  language code 
style  associated style info 
title  advisory title 

Events

Event Description
onclicka pointer button was clicked 
ondblclicka pointer button was double clicked 
onkeydowna key was pressed down 
onkeypressa key was pressed and released 
onkeyupa key was released 
onmousedowna pointer button was pressed down 
onmousemovea pointer was moved within 
onmouseouta pointer was moved away 
onmouseovera pointer was moved onto 
onmouseupa pointer button was released 



© htmlpedia.net 2008 - 2012