Text Content

HTML <div> element

Provides a generic flow-content container with no inherent semantic meaning. Choose a meaningful element when one fits. Use div for layout, styling or scripting when no existing semantic element fits. It is not inherently a section, landmark or control; adding a click handler does not make it a native button. It accepts global HTML attributes; individual global features may be inapplicable or restricted.

Formal Syntax & Structure

html syntaxhtml
<div>Content</div>

Return Value

HTMLDivElement

Content model: Flow content; context-specific ancestor restrictions may apply.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>HTML example</title>  </head>  <body>    <div class="card">      <p>Reading list</p>    </div>  </body></html>
HTML Reference