The div and span tags are used in HTML to apply CSS styling and Javascript functionalities. They serve no purpose by themselves, they only work when applied with CSS or JavaScript.
1. div:
It’s a block level element. Meaning it covers the full width available. Its main use is to group larger chunks of HTML to apply styles to them or perform some JavaScript operations.
Example:
```
```
In this example, a div element is used to group a heading tag. We can then add some
CSS to style this div, for example:
```
#header {
background-color: blue;
color: white;
text-align: center;
}
```
1. span:
It’s an inline element and it’s mainly used to group small chunks of
HTML elements, text or for applying style or performing operations with Javascript on inline elements.
Example:
```
My mother has blue eyes.
```
We can then add some
CSS to style this span, for example:
```
.eyesColor {
color: blue;
}
```
In this case, the color of the text inside the span tag will be blue.