跳到正文
Skillpedia
网站与界面(前端)75k · #2832

empty-links

它能做什么

这项技能检查网页上的链接是否缺少文字或文字不清楚。适用于希望链接人人都能理解的开发者。

适用场景

  • ✓当屏幕阅读器只朗读“链接”一词,而没有任何上下文的时候。
  • ✓当页面上的链接只有图标、没有文字描述的时候。
  • ✓当你在上线前检查链接是否指向失效的目标的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/empty-links/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/empty-links/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查我的页面中是否有没有可读文字的链接。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会查找既没有可见文字、也没有无障碍标签的链接。它会建议添加文字或 aria-label,并修复或删除失效的链接。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Fix empty and broken links

Screen readers announce empty links as just 'link' with no context—users have no idea where they lead or what they do, making navigation impossible.

Quick Reference

  • Every link must have accessible text (visible or via aria-label)
  • Icon-only links need aria-label describing the destination
  • Empty anchor tags are completely inaccessible—always add content
  • Use visually-hidden text when visual labels aren't desired

Check

Scan for links with no text content (empty anchor tags, icon-only links without labels). Verify all links have accessible names via text content, aria-label, or aria-labelledby. Check for broken link destinations.

Fix

Add descriptive text to empty links. For icon-only links, add aria-label describing the destination. Use visually-hidden text if visible labels are not desired. Remove or fix broken links.

Explain

Explain how screen readers announce empty links as just 'link' with no context, leaving users unable to understand where the link leads or what action it performs.

Code Review

Review the rendered markup and interactive states that affect Fix empty and broken links. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/empty-links

常见问题

空链接为什么重要?

屏幕阅读器会把它朗读为“链接”,用户无法得知它通往哪里。

只有图标的链接怎么修复?

这项技能建议添加一个描述目标地址的 aria-label。

它会检查链接是否有效吗?

这项技能说明,除了检查缺少名称的链接,也会查找失效的链接目标。

详情

作者的原始描述

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Fix empty and broken links. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2832
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能