<div>...</div>

HTML4 HTML5

Defines a block container/division.

Both opening and closing tags are required.

Attributes:

align="..." - Alignment of inner elements. Deprecated in HTML4, removed in HTML5 (though widely supported). CSS styles should be used instead.

Example

Code:

<div style="background-color: #e9ecef; border: 1px dashed #6c757d; padding: 15px; border-radius: 4px;"> <h3 style="margin-top: 0; color: #495057;">Information Card</h3> <p style="margin-bottom: 0;">This is content placed inside a div element with background and border.</p> </div>

The browser will interpret this code as follows:

Information Card

This is content placed inside a div element with background and border.