---
id: 587d7788367417b2b2512aa2
challengeType: 0
videoUrl: 'https://scrimba.com/c/czVwWSv'
forumTopicId: 301024
title: 使用 nav 元素使屏幕阅读器更容易导航
---
## Description
nav
也是一个具有语义化特性的 HTML5 标签,用于呈现页面中的主导航链接。它可以使屏幕阅读器快速识别页面中的导航信息。
对于在多个页面底部出现的站点链接,不需要使用nav
,用footer
(在下个挑战中介绍)会更好。
## Instructions
Camper Cat 在他的忍者训练页面顶端使用了很多导航链接,但把它们写在了div
中。请将div
更改为nav
标签,以提升页面的可访问性。
## Tests
```yml
tests:
- text: '你的代码应该有 1 个nav
标签。'
testString: assert($('nav').length == 1);
- text: '你的nav
标签应该包含ul
标签及其列表项。'
testString: assert($('nav').children('ul').length == 1);
- text: '你的代码不应包含div
标签。'
testString: assert($('div').length == 0);
- text: '确保你的nav
标签是闭合的。'
testString: assert(code.match(/<\/nav>/g) && code.match(/<\/nav>/g).length === code.match(/
## Challenge Seed
```html
Stealth & Agility Training
Climb foliage quickly using a minimum spanning tree approach
No training is NP-complete without parkour
Combat Training
Dispatch multiple enemies with multithreaded tactics
Goodbye world: 5 proven ways to knock out an opponent
Weapons Training
Swords: the best tool to literally divide and conquer
Breadth-first or depth-first in multi-weapon training?
```
## Solution
```html
// solution required
```