<div> Tag Syntax
<body> ... ... flow content expected ... <div> ... flow content ... </div> ... </body>
Rules for coding HTML div
elements
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Include a div element where flow content is expected.
- Begin the div element with a starting <div> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Inside the div element, between the starting
<div>
tag and the ending</div>
tag, code the inner HTML flow content. - End the div element with a matching
</div>
closing tag.
<div> Content Model
Content of the div element
The content of the div element can include HTML comments, text content and any tags that can be used in flow content.