惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
Vercel News
Vercel News
Microsoft Azure Blog
Microsoft Azure Blog
爱范儿
爱范儿
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
H
Help Net Security
罗磊的独立博客
The Cloudflare Blog
J
Java Code Geeks
博客园 - 叶小钗
I
InfoQ
B
Blog
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
月光博客
月光博客
博客园_首页
雷峰网
雷峰网
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
美团技术团队
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Semantic Tags in HTML
Raja B · 2026-05-24 · via DEV Community

Raja B

What are Semantic Tags in HTML?

Semantic tags are HTML tags that clearly describe the meaning or purpose of the content inside them.

semantic means “with meaning.” So, a semantic tag tells both the developer and the browser what the content is about.

Let’s break it down step by step.

1. Why Are They Called “Semantic”?

The word “semantic” comes from “meaning.”
When you use semantic tags, you’re telling the browser, “Hey, this part is a heading” or “This section is a navigation bar” or “This area is the main content.”

This helps:

  • Browsers understand how to display it

  • Search enginesunderstand what’s important

  • Screen readers(used by blind users) read the content properly

  • A semantic tag (like , , , etc.) clearly tells you what the content is for.

Example:

<article>This is a blog post</article>

Now, even without looking at the content, we know it’s a blog post, because it’s inside an <article>tag.

2. Why Should You Use Semantic Tags?

Using semantic tags has many benefits:

a) Improves Code Readability

When other developers (or even future-you) read your HTML code, it’s easier to understand.

Instead of seeing this:

<div id=”header”>

<div id=”nav”>

<div id=”main”>

You can write this:

<header>

<nav>

<main>

This is much cleaner and meaningful.

b) Helps Search Engines (SEO)

Search engines like Google look at your HTML tags to decide what your page is about.

Using semantic tags helps them:

  • Index your site correctly

  • Show your site in search results more accurately

c) Better for Accessibility

People who can’t see use screen readers. These tools read your HTML and speak it aloud.

If you use proper tags, the tool can say:

  • “This is the main content”

  • “This is a navigation menu”

  • “This is a footer”

This gives a better experience for disabled users.

d) Future-Proof Your Code

Browsers and tools are built to understand semantic tags better. They may add new features, improve performance, or give better support in future updates if your code is semantic.

Semantic Tags

Tag          Meaning (in simple words)
<header>     Top part of the page (like a title or logo)
<nav>            Navigation menu (links to other pages)
<main>           Main content area of the page
<section>    A section of content (like a chapter)
<article>    An independent piece (like a blog post)
<aside>          Side content (like ads or side notes)
<footer>     Bottom part of the page (like copyright)
<figure>     A picture or diagram with a caption
<figcaption>     The caption for a figure or image
<time>           Shows a date or time value
<mark>           Highlights important text
<address>    Contact information
<summary>    Summary of collapsible content
<details>    Expandable section for hidden content

3. Do Semantic Tags Affect How the Website Looks?

No, not directly. Semantic tags don’t change the appearance of the webpage by default.

You need to use CSS to style them. But their main job is to add meaning, not design.

4. Where Are Semantic Tags Used?

You use semantic tags almost everywhere in an HTML document:

  • Website layout (header, footer, main)

  • Blog posts (article, section)

  • Menus (nav)

  • Images with captions (figure, figcaption)

They make the entire HTML page more understandable.

Will be learn

Semantic tags are like labels that explain what each part of your page does.

Without them, your HTML is just a pile of boxes.
With them, it becomes a well-organized, meaningful structure that is:

  • Easier to read

  • Easier to maintain

  • Better for Google

  • Better for users

Semantic Tag

Reference: