div in HTML

Published in Development on Mar 4, 2021

You can think of a web page in three major chunks. You’ve got the header and footer and, in between, the main body. But when looking at any web page, you can see the body is made up of sections, too. There’s likely a section for products and services, testimonials, team members, contact information, and more.

Each of these sections probably looks a little different. Maybe they have different colors and fonts. Maybe one has a parallax background and one has a video background. Maybe one is made up of multiple rows and columns, and so on.

This variation in styling is possible because of the content division element in HTML. Better known as “div,” this element can divide your web page into sections so you can target them with unique CSS properties.

In HTML, the div tag is a generic block-level container for other elements.

Let’s look at a few key terms in this definition.

First, a div is a “generic” container because it doesn’t describe the content it contains. Other elements like