**`<div>`** is the block-level counterpart to `<span>`: it carries **zero semantic meaning**, applies no default styling beyond taking up its own line (block display), and exists purely to group other elements — usually so you can apply a CSS class, an id, or JavaScript behavior to that group as a unit. Modern HTML5 provides more meaningful alternatives for common structural roles — `<header>`, `<nav>`, `<main>`, `<article>`, `<section>`, `<footer>` — and you should reach for those first when one actually fits.
1Understanding <div>
`<div>` is the block-level counterpart to <span>: it carries zero semantic meaning, applies no default styling beyond taking up its own line (block display), and exists purely to group other elements — usually so you can apply a CSS class, an id, or JavaScript behavior to that group as a unit. Modern HTML5 provides more meaningful alternatives for common structural roles — <header>, <nav>, <main>, <article>, <section>, <footer> — and you should reach for those first when one actually fits.
A page built entirely out of nested <div>s ('divitis') gives screen readers and search engines no structural information at all — replacing the outer layout divs with <header>/<main>/<footer>/<nav> costs nothing visually but adds real semantic value.
<div class="card">
<h2>Product Name</h2>
<p>$29.99</p>
</div>2Practical Example
Here is a real-world application of <div> showing how it is used in production HTML.
<!-- Better: semantic elements instead of all-div layout -->
<main>
<article>
<h1>Blog Post Title</h1>
<p>Content...</p>
</article>
</main>3Best Practices
Follow these guidelines when working with <div>:
1. Use a semantic element (<header>, <main>, <section>, <article>, <footer>, <nav>) instead of <div> whenever one fits
2. Reserve <div> for purely presentational grouping with no inherent meaning
3. Attach class/id to <div> for CSS/JS hooks, keeping class names meaningful for maintainability
Tip: A page built entirely out of nested <div>s ('divitis') gives screen readers and search engines no structural information at all — replacing the outer layout divs with <header>/<main>/<footer>/<nav> costs nothing visually but adds real semantic value.
<div class="card">
<h2>Product Name</h2>
<p>$29.99</p>
</div>