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.


<!DOCTYPE html>
		<title>My Document Title</title>
		<h1>My first Heading</h1>
		<p>Paragraph one</p>
		<div style="border:5px solid blue;">
			Paragraph two
		<p>Paragraph three</p>

Save & refresh browser:

My first Heading

Paragraph one

Paragraph two

Paragraph three

Leave a Reply