<div>

BrandonDusch580 total contributions
Published Jun 10, 2021Updated Jul 1, 2022
Contribute to Docs
The <div>
element represents a generic division of content. It has no semantic meaning, but will separate its contents from the rest of the document.
Syntax
<div><!-- Content lives here --></div>
The <div>
tags that wraps around a block of HTML. By default it is a block element, meaning its contents will start on a new line and the content that follows will start on a new line.
Example
A <div>
is a good choice when no other tag matches the content type. Additionally it is often used to help style an entire page, or sections of a page via the class
or id
attribute.
<html><head> </head><body><!-- This div wraps the entire site applying the styles from the dark-mode class --><div class="dark-mode"><!-- Site content lives here --></div></body></html>
All contributors
- BrandonDusch580 total contributions
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- short_matthew_f33 total contributions
- BrandonDusch
- christian.dinh
- Anonymous contributor
- short_matthew_f
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.