|
|
HTML <div> tag
Syntax
<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
right
center
justify |
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.
Example
| 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
|
|
|