From http://www.w3schools.com (Copyright Refsnes Data)
The <div> tag defines a division/section in a document.
The "align" attribute which was deprecated in HTML 4.01, is not supported in HTML 5. Use CSS instead.
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.
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 sectionThis is a paragraph in a div section |
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 |
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard Attributes in HTML 5.
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)