Definition:
The Div means division of elements. It divides the webpage into different sections.
These sections work like block-level containers that take the full width and provide many features, such as:
- It gives a new line if you use many div elements in your webpage.
- Create a clean, attractive, and well-organized webpage layout.
- To apply the CSS style to the internal and external sections of the div.
There are some listed div elements as follows:
Div Elements
│
├── Layout Divs
│ ├── Header Div
│ ├── Navbar Div
│ ├── Sidebar Div
│ ├── Footer Div
│ ├── Container Div
│ ├── Wrapper Div
│ ├── Section Div
│ └── Main Div
│
├── Content Divs
│ ├── Content Div
│ ├── Article Div
│ ├── Card Div
│ ├── Banner Div
│ ├── Gallery Div
│ └── Form Div
│
├── Structure Divs
│ ├── Box Div
│ ├── Nested Div
│ ├── Flex Div
│ └── Grid Div
│
└── Interactive Divs
├── Menu Div
└── Popup Div
Syntax:
<div>
Your content goes here
</div>
Example:
<!DOCTYPE html>
<html>
<body>
<div>
<h1>Welcome to HTML div element</h1>
<p>It provides the block-level containers.</p>
</div>
</body>
</html>
Output:
Welcome to HTML div element
It provides the block-level containers.
