semantic-lists
它能做什么
这个技能找出由普通 div 构成的相关项目分组,例如菜单、功能、步骤和术语表,并把它们改为正确的列表标记。它面向希望辅助技术能理解其内容的网站构建者。
适用场景
- ✓你请智能体检查页面上相关项目分组是如何标记的时候。
- ✓页面中的菜单、步骤或功能列表是用看起来像列表的 div 构成的时候。
- ✓你需要对术语和定义的配对(例如术语表或常见问题)进行正确标记的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/semantic-lists/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我网站上的功能列表和步骤都是用普通 div 做的。请帮我把它们改成正确的列表元素吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会找出相关项目的分组,并用 ul 包裹无序列表,用 ol 包裹有编号的步骤,或用 dl 包裹术语和定义的配对。然后它会在其中加入对应的 li、dt 和 dd 元素。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Use semantic list elements
Screen readers announce list structure and item count—'list with 5 items'—helping users understand content organization. Styled divs provide no context.
Quick Reference
- Use <ul> for unordered lists (navigation, features, bullets)
- Use <ol> for ordered sequences (steps, rankings, instructions)
- Use <dl> for term-definition pairs (glossaries, FAQs)
- Screen readers announce 'list with X items' for proper lists
Check
Identify groups of related items (navigation menus, product features, steps) and verify they use ul, ol, or dl elements rather than divs or spans styled to look like lists.
Fix
Wrap related items in appropriate list elements: ul for unordered lists, ol for numbered sequences, dl for term-definition pairs. Use li for list items and proper dt/dd for definition lists.
Explain
Explain how screen readers announce 'list with X items' to help users understand content structure, and why styled divs provide no semantic information about grouped content.
Code Review
Review the rendered markup and interactive states that affect Use semantic list elements. 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/semantic-lists
常见问题
屏幕阅读器读到真正的列表时会说什么?
这个技能说,它会播报类似“包含 5 项的列表”的内容,帮助用户理解内容。
什么时候应使用 ol 而不是 ul?
当顺序重要时,例如步骤、排名或说明,使用 ol;其他分组使用 ul。
这次修改后外观会改变吗?
如果样式依赖 div,外观可能会改变,因此智能体应在修改后检查布局。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Use semantic list elements. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #3013
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。