div

What is <div>?

The <div> (short for "division") element is a generic container in HTML that is used to group together HTML elements. It does not add any semantic meaning to the content but is a useful tool for styling and structuring a webpage.

Uses of <div>

The <div> element is commonly used for:

Examples of <div>

Example 1: Basic Usage

This is a simple <div> containing a paragraph.

Example 2: Styling with CSS

In this example, the <div> is styled using CSS:

This <div> has a yellow background and some padding.

Example 3: Layout Structure

This <div> is used to create a simple layout:

Column 1
Column 2