HTML | PHP | Forum

HTML <div> tag


<div> - </div>

Definition and Usage

The DIV element offers a generic mechanism for adding structure to documents.The DIV element defines a generic block-level container, allowing authors to provide style or language information to blocks of content. The DIV element is most useful in combination with the CLASS, ID, or LANG attributes.

Optional Attributes

Attribute Value Description
align left
Defines the way the text is aligned in the div element. Deprecated. Use styles instead.

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onfocus, onblur, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


Source Output
This is a text <div style="color:#0000FF;">
inside the div section
</div> and outside
This is a text
inside the div section
and outside


Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<h1> to <h6>


Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us