HTML Div Tag
The <div> tag stands for “division”. It is a container element that is used to group together blocks of content. It doesn't change how things look by itself — instead, it helps organize the page so you can style or control sections more easily using CSS or JavaScript.
Think of <div> as a plain empty box. You can fill it with content like text, images, or other HTML tags, and then style or position that entire box as a unit.
Syntax -
<div>
<!-- Your content goes here -->
</div>
It’s a container, so anything inside the <div>...</div> will be part of that section.
Example -
Scenario1 - A Simple FAQ Block
<!DOCTYPE html>
<html>
<head>
<title>div tag text example.. </title>
</head>
<body>
<div style="background-color:green;">
<h2>Heading</h2>
<p>This is paragraph</p>
</div>
</body>
</html>
Output -
Heading
This is paragraph