avatar

Hassan khan

Last updated: December 22,2022

Div tag in html

Div tag in HTML


Div tag of HTML stands for division. The short form is div. Div tag of HTML group your other tags such as h1 tag and p tag etc. You can say it is a container that contains other tags.


The basic structure of div tag:

1
2
3
4
<div>
  <h1>This heading tag</h1>
  <p>This paragraph tag</p>
</div>

Explanation:

The div tag contains two more tags named h1 and p tag.
The h1 tag and p tag will take full line as these are also block tags.


Share