Back to Concepts
<div>
A generic container for grouping content.
The `<div>` tag defines a division or a section in an HTML document. It is the most common container used in web development. By itself, it has no effect on the content or layout. However, when styled with CSS, it becomes a powerful tool for creating layouts, grouping elements, and applying styles to sections of content.
✦ In The Wild
Seen in: Instagram
Post Container
Every single post card on your feed is wrapped in a <div>. It holds the header, the image, and the comments together.
📱
Live Example & Code
Preview Output
<div style="background-color: #333; color: white; padding: 20px;">
<h2>I am a Div</h2>
<p>I group content together.</p>
</div>