HTML Elements: <p>

By: Dusty Arlia
Published on July 23, 2012
Last Updated on Monday, August 04, 2014 at 9:32 PM
Total Updates: 3

The <p> HTML tag is used to insert a paragraph into your webpage. Place your text in between the opening paragraph tag (<p>) and the closing paragraph tag (</p>). The <p> element will have some spacing before and after it. The browser determines how much space will come before and after the paragraphs by default. Different browsers have will have different defaults. You can override this manually by using CSS to control the spacing. By using CSS you can be sure that the page will look the same in all browsers.



Standard Attributes

The <p> tag supports the following standard attributes:

Attribute Value Description
class classname specifies a classname for an element
dir rtl; ltr Specifies the text direction for the content in an element
id id Specifies a unique id for an element
lang language_code Specifies a language code for the content in an element
style style_definition Specifies an inline style for an element
title text Specifies extra information about an element
xml:lang language_code Specifies a language code for the content in an element, in XHTML documents


Event Attributes

The <p> tag supports the following event attributes:

Attribute Value Description
onclick script Script to be run on a mouse click
ondblclick script Script to be run on a mouse double-click
onmousedown script Script to be run when mouse button is pressed
onmousemove script Script to be run when mouse pointer moves
onmouseout script Script to be run when mouse pointer moves out of an element
onmouseover script Script to be run when mouse pointer moves over an element
onmouseup script Script to be run when mouse button is released
onkeydown script Script to be run when a key is pressed
onkeypress script Script to be run when a key is pressed and released
onkeyup script Script to be run when a key is released

Comments:

Ad: