The <div> document division element is a block level element that acts as a container, encapsulating content and dividing the document into sections.
- Starts a new line
- Stretches across the width of its container
- Acts as a container for other elements
CSS is generally applied to provide styling to a <div>, enabling all elements contained with the div to be styled at the same time.
Divs can be nested, and also as an example styled with CSS to say perform width adjustments or apply a specific font.
<title>My Document Title</title>
<h1>My first Heading</h1>
<div style="border:5px solid blue;">
Save & refresh browser:
My first Heading