HTML 5 div tag

From http://www.w3schools.com (Copyright Refsnes Data)

# HTML 5 <div> tag

## Definition and Usage

The <div> tag defines a division/section in a document.

## Differences Between HTML 4.01 and HTML 5

The "align" attribute which was deprecated in HTML 4.01, is not supported in HTML 5. Use CSS instead.

## Tips and Notes

Note: Browsers usually place a line break before and after the div element.

Tip: Use the <div> tag to group block-elements to format them with styles.

## Example

Source | Output
--- | ---

This is some text <div style="color:#FF0000;">
<h4>This is a header in a div section</h4>
<p>This is a paragraph in a div section</p>
</div>

This is some text

#### This is a header in a div section

This is a paragraph in a div section

## Attributes

- 4: indicates if the attribute is defined in HTML 4.01
- 5: indicates if the attribute is defined in HTML 5

Attribute | Value | Description | 4 | 5
--- | --- | --- | --- | ---
align | left right top bottom | How to align the text in the div element. Not supprted. Use styles instead. | 4 |

## Standard Attributes

class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title

For a full description, go to Standard Attributes in HTML 5.

## Event Attributes

onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload

For a full description, go to Event Attributes in HTML 5.

From http://www.w3schools.com (Copyright Refsnes Data)