Semantic HTML uses elements that clearly describe their meaning and purpose.
Instead of using generic elements like <div>, semantic elements describe the type of content they contain.
Benefits include:
A typical semantic webpage looks like this:
Website
│
├── Header
├── Navigation
├── Main
│ ├── Section
│ ├── Article
│ └── Aside
└── Footer
header)The <header> element represents introductory content.
It usually contains:
<header>
<h1>My Website</h1>
<p>Learn Frontend Development</p>
</header>
Typical layout:
--------------------
Logo
Site Name
Navigation
--------------------
nav)The <nav> element contains navigation links.
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
Output:
Home | About | Contact
Common uses:
main)The <main> element contains the primary content of the page.
Each page should contain only one <main> element.
<main>
<h2>Frontend Development</h2>
<p>
Learn HTML, CSS, and JavaScript.
</p>
</main>
Structure:
Header
Navigation
Main Content
Footer
section)The <section> element groups related content together.
<section>
<h2>HTML</h2>
<p>
HTML structures web pages.
</p>
</section>
Common uses include:
Example:
<section>
<h2>About Us</h2>
</section>
<section>
<h2>Our Services</h2>
</section>
article)The <article> element represents independent content.
The content should still make sense if viewed on its own.
<article>
<h2>Learn HTML</h2>
<p>
HTML is the foundation of web development.
</p>
</article>
Common uses:
section
Website
└── About Section
A section is part of a larger page.
article
Website
└── Blog Post
An article can stand on its own.
aside)The <aside> element contains content related to, but separate from, the main content.
<aside>
<h3>Related Articles</h3>
<ul>
<li>CSS Basics</li>
<li>JavaScript Intro</li>
</ul>
</aside>
Common uses:
Example layout:
---------------------
Main Article
Sidebar
Related Posts
---------------------
footer)The <footer> element contains information about the page or website.
<footer>
<p>© 2026 My Website</p>
</footer>
Common content includes:
blockquote)The <blockquote> element represents a long quotation.
<blockquote>
The best way to predict the future
is to create it.
</blockquote>
Output:
The best way to predict the future is to create it.
Common uses:
cite)The <cite> element represents the title of a work.
<cite>
Clean Code
</cite>
Output:
Clean Code
Common uses:
q)The <q> element represents a short inline quotation.
<p>
Steve Jobs said
<q>Stay hungry, stay foolish.</q>
</p>
Output:
Steve Jobs said "Stay hungry, stay foolish."
abbr)The <abbr> element defines an abbreviation.
<abbr title="HyperText Markup Language">
HTML
</abbr>
When the user hovers over the text:
HTML
↑
HyperText Markup Language
Benefits:
address)The <address> element contains contact information.
<address>
Mechinagar-7, Jhapa<br>
Nepal<br>
samir@example.com
</address>
Common uses:
dfn)The <dfn> element marks a term being defined.
<p>
<dfn>HTML</dfn>
is the standard markup language
for web pages.
</p>
Common uses:
del)The <del> element represents deleted content.
<p>
Price:
<del>$100</del>
$80
</p>
Output:
Price: ~~$100~~ $80
Common uses:
ins)The <ins> element represents inserted content.
<p>
Price:
<ins>$80</ins>
</p>
Output:
Price: $80
The inserted content is usually underlined.
Common uses:
s)The <s> element represents content that is no longer accurate.
<p>
<s>Registration Closed</s>
</p>
Output:
~~Registration Closed~~
del vs sdel
<del>$100</del>
Meaning:
The content was removed.
s
<s>Available</s>
Meaning:
The content is no longer accurate.
<header>
<h1>Frontend Blog</h1>
</header>
<nav>
<a href="/">Home</a>
<a href="/articles">Articles</a>
</nav>
<main>
<section>
<h2>Latest Articles</h2>
<article>
<h3>Learn HTML</h3>
<p>
HTML is the foundation of web development.
</p>
</article>
</section>
<aside>
Related Resources
</aside>
</main>
<footer>
© 2026 Frontend Blog
</footer>
Semantic HTML gives meaning to webpage content.
<header>
<nav>
<main>
<section>
<article>
<aside>
<footer>
Instead of filling your webpage with generic <div> elements, semantic elements make your code easier to read, improve accessibility, and help search engines better understand your content.