<div> is a block-level element that wraps entire sections, whereas <span> is an inline element that groups smaller parts of text or elements within a paragraph. Both are mainly used for structuring content and styling purposes.
Semantic Tags
Semantic HTML tags clarify the role of a content section. Examples include:
<header>: page header
<nav>: navigation area
<main>: main content of the page
<section>: thematically separated section
<article>: standalone post or article
<footer>: page footer
Semantics improves readability for developers, enhances search engine optimization (SEO), and supports screen readers for accessibility. It ensures that content and layout are clearly separated.
Example
The following example demonstrates a simple semantic structure of a webpage.