Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 685 Bytes

File metadata and controls

22 lines (16 loc) · 685 Bytes
created 2026-05-03 23:47
source https://www.freecodecamp.org/learn/responsive-web-design-v9/lecture-html-fundamentals/what-are-div-elements
tags
HTML
Literature

What is a div?

The div element will be used mostly to group [[HTML elements]] which share a set of [[CSS styles]]

The div element does not have a [[semantic]] meaning.

When should I use a div?

Make sure not to overuse div. Other [[HTML elements|elements]] maybe more appropriate to use on various occasions. E.g., if you want to divide content into multiple sections, don't use div, use [[section]], instead.

Example of div

<div>
  <p>Example paragraph element.</p>
</div>