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.
The <div>
element is commonly used for:
This is a simple <div>
containing a paragraph.
In this example, the <div>
is styled using CSS:
This <div>
has a yellow background and some padding.
This <div>
is used to create a simple layout: