Menu

Semantic HTML Tags
πŸ“°

Semantic HTML Tags

DEV CommunityΒ·Tech WebsterΒ·7 months ago
#aShQPSuH
#example#nonsemantic#html#webdev#semantic
Reading 0:00
15s threshold

Understanding Semantic HTML Tags: A Complete Beginner-Friendly Guide

When building web pages, HTML is not just about structureβ€”it’s also about meaning .

This is where Semantic Tags come into play.

Semantic HTML helps both developers and browsers understand what each part of your webpage represents.

🧠 What Are Semantic Tags?

Semantic tags clearly describe their meaning in a human- and machine-readable way.

Example:

<header> This is the header </header>

Enter fullscreen mode

Exit fullscreen mode

Instead of using:

<div> This is the header </div>

Enter fullscreen mode

Exit fullscreen mode

πŸ‘‰ The first example is better because <header> tells us the purpose directly.

❌ Non-Semantic vs βœ… Semantic

Non-Semantic:

<div> <div> Logo </div> <div> Menu </div> </div>

Enter fullscreen mode

Exit fullscreen mode

Semantic:

<header> <h1> Logo </h1> <nav> Menu </nav> </header>

Enter fullscreen mode

Exit fullscreen mode

πŸ‘‰ Semantic HTML improves:

Code readability

SEO

Accessibility

πŸ—οΈ Common Semantic…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.