Search...

HTML Div

The <div> element is often used as a container for other HTML elements.

The <div> Element

The `<div>` element has no special meaning at all. It represents its children. It can be used with the `class`, `lang`, and `title` attributes to mark up semantics common to a group of consecutive elements.

When used together with CSS, the `<div>` element can be used to style blocks of content.

<div> Example
Result

Center Align a <div> Element

If you want to center align a `<div>` element, you can use the CSS `margin: auto;` property:

Center Align <div> Example
Result