About Lesson
Definition:
In HTML, the <div>
element is a generic container used to group together other HTML elements and content. It stands for “division” or “divider” and is one of the most commonly used elements for creating layout structures and organizing content on a web page.
The <div>
element itself doesn’t inherently provide any visual formatting or styling. Instead, it acts as a block-level container that can be styled using CSS or manipulated using JavaScript to control its appearance, layout, and behavior.
Syntax:
<div>..................content...............</div>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<div>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</div>
</body>
</html>