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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Jina AI
Jina AI
The Cloudflare Blog
V
Visual Studio Blog
博客园_首页
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园 - Franky

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
Your `<nav>` label already says 'navigation'
Leo · 2026-06-27 · via DEV Community

Leo

Open the page, hit the landmarks key, and the assistive tech reads what your markup told it. If the markup says one thing twice, the user hears it twice. That is the small but real cost of an accessible name that restates the role it sits on — and a <nav> element labelled "Primary navigation" is the example almost every site ships with.

CSS-Tricks ran a short link-post on June 12 from Geoff Graham, pointing at Mark Underhill's argument that the word "navigation" has no business being inside the accessible label on a <nav>. The argument is small. The habit it pushes back on is everywhere.

Listen to what gets announced

Per the CSS-Tricks summary, a <nav> labelled with aria-label="Primary navigation" is read out as "Navigation, Primary navigation." The first half comes from the landmark role itself. The second half comes from you. For a sighted user that string never surfaces. For a screen-reader user it is the thing they hear every time they land on the region.

So the label is doing two jobs and only one of them is useful. The role announcement already tells the user this is a navigation region. The label is supposed to distinguish this navigation region from the others on the page — the footer set, the in-page table of contents, the breadcrumb. "Primary" does that. "Primary navigation" does that and then says "navigation" again, for no one.

The fix is not subtle:

<nav aria-label="Primary">
  <!-- links -->
</nav>

That is it. One word, doing the disambiguating work, sitting next to a role the platform is already announcing for free.

The principle generalises

The source extends the same idea to alt text, and it is worth carrying across because it is the same shape of bug. An <img> is announced as an image. Writing alt="Image of a red bicycle" tells the user "image, image of a red bicycle." The word "image" inside the alt value is restating the role of the element it lives on.

The corrected version is the obvious one:

<img src="bike.jpg" alt="A red bicycle leaning against a brick wall">

The image-ness comes from the element. The alt value describes what the image shows. Two different jobs, two different places to do them, no overlap.

You can apply the same test wherever you write an accessible name. If the role of the element already announces a noun — navigation, image, button, list — that noun does not need to appear inside the name you write. The name is for the thing only you know: which navigation, which image, which button.

Why this keeps happening

The habit usually comes from a good instinct. Authors want to be explicit. They want the label to read cleanly when they say it out loud in a design review. "Primary navigation" sounds more complete than "Primary." It is the kind of small extra word that feels respectful, the way you might write "click the Submit button" in instructions.

But the audience for an accessible name is not a sighted reviewer reading the attribute. It is a person hearing the role and the name back-to-back. "Complete" sentences in that channel become repetition. Graham closes the link-post with the related guidance that accessible text should be kept succinct — per the source, "it doesn't have to be a novel." That instruction is doing more work than it looks like.

Once you start listening for the doubled role-name, you start noticing it everywhere — the <nav aria-label="Main navigation">, the alt="Picture of...", the <button> with a title="... button". None of these are catastrophic. All of them are friction you can remove with a five-character edit.

What to actually do

The judgement is straightforward. The role announcement is the platform's job. The accessible name is your job. Keep them separate.

Take this to your next pass over the markup:

  • Audit every aria-label and aria-labelledby on a <nav>. If the value contains the word "navigation," drop it. Keep only the disambiguating word — "Primary," "Footer," "Breadcrumb," "Table of contents."
  • Audit alt values for "image of," "picture of," "photo of," and "graphic of." Cut the lead-in; keep the description.
  • When you write an accessible name for any element, say it out loud after the element's role. If you hear the role word twice, the name is doing the wrong job.
  • Keep names short. The source's closing line is the standard: succinct, not a novel.

The platform is already telling the user what kind of region they have landed on. Your job is to tell them which one. Anything more is noise, and noise is something a screen-reader user cannot scroll past.