<div>

Text

A generic container for flow content with no semantic meaning. Used extensively for layout, grouping, and styling purposes.

Common Attributes

role

Example

<div class="container">
  <p>Content inside a div.</p>
</div>

About the <div> Element

The <div> HTML element belongs to the Text category of HTML elements. A generic container for flow content with no semantic meaning. Used extensively for layout, grouping, and styling purposes. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.

The <div> element requires both an opening <div> and closing </div> tag. Content placed between these tags becomes the element's children. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.

Proper use of semantic HTML elements like <div> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.

Related Elements