Link Text Not Descriptive Accessibility Fix
In this tutorial, you'll learn about Link Text Not Descriptive Accessibility Fix. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
The Problem
Screen reader users can navigate by jumping between links on a page. When link text is vague ("click here", "read more", "learn more"), the user cannot tell where each link goes without reading surrounding content. Non-descriptive link text fails WCAG 2.4.4.
Quick Fix
Step 1: Use descriptive link text
<!-- Wrong — vague link text -->
<a href="/products/123">Click here</a> to view our product details.
<!-- Right — descriptive link text -->
<a href="/products/123">View Doda Browser Pro details</a>
Step 2: Avoid "read more" and "learn more"
<!-- Wrong — same text for multiple links -->
<a href="/tutorials/js">Learn more</a>
<a href="/tutorials/css">Learn more</a>
<a href="/tutorials/ts">Learn more</a>
<!-- Right — unique, descriptive text -->
<a href="/tutorials/js">JavaScript tutorials</a>
<a href="/tutorials/css">CSS tutorials</a>
<a href="/tutorials/ts">TypeScript tutorials</a>
Step 3: Use aria-label when link has no text
<!-- Wrong — icon-only link with no accessible name -->
<a href="/settings">
<span class="icon-gear"></span>
</a>
<!-- Right — add aria-label -->
<a href="/settings" aria-label="Settings">
<span class="icon-gear" aria-hidden="true"></span>
</a>
Step 4: Use aria-labelledby for complex link text
<!-- Wrong — link text is not descriptive -->
<article>
<h2 id="article-title">Getting Started with DodaZIP</h2>
<p>A complete guide to file compression...</p>
<a href="/articles/getting-started-dodazip">Read more</a>
</article>
<!-- Right — use the title as the link name -->
<article>
<h2 id="article-title">Getting Started with DodaZIP</h2>
<p>A complete guide to file compression...</p>
<a href="/articles/getting-started-dodazip" aria-labelledby="article-title">
Read more about this topic
</a>
</article>
Step 5: Make link purpose clear
<!-- Wrong — link text does not indicate file type or action -->
<a href="/files/report.pdf">Download</a>
<!-- Right — include file type and size -->
<a href="/files/report.pdf">Download performance report (PDF, 2.4MB)</a>
<!-- For external links, indicate they open in a new tab -->
<a href="https://example.com" target="_blank" rel="noopener">
Visit Example.com (opens in new tab)
</a>
Prevention
- Write link text that describes the destination (4-8 words)
- Never use "click here", "read more", "details", "link" as link text
- Each link on a page should have unique text
- Include file type and size for downloadable files
- Indicate when links open in a new window
Common Mistakes with link text
- Using
headandtailinstead of pattern matching, causing runtime errors on empty lists - Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
- Using
returnto exit a function early instead of wrapping a pure value in the monad
These mistakes appear frequently in real-world A11Y code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro