2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
id: 587d7788367417b2b2512aa3
|
2020-12-16 00:37:30 -07:00
|
|
|
title: 使用 footer 元素使屏幕阅读器更容易导航
|
2018-10-10 18:03:03 -04:00
|
|
|
challengeType: 0
|
2020-02-11 17:06:41 +08:00
|
|
|
videoUrl: 'https://scrimba.com/c/crVrDh8'
|
|
|
|
forumTopicId: 301022
|
2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --description--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
与`header`和`nav`类似,`footer`也具有语义化特性,可以使辅助设备快速定位到它。它位于页面底部,用于呈现版权信息或者相关文档链接。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --instructions--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
Camper Cat 的忍者训练页面进展顺利。请将他在页面底部呈现版权信息的`div`标签更改为`footer`标签。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --hints--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
你的代码中应该包含 1 个`footer`标签。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
```js
|
|
|
|
assert($('footer').length == 1);
|
2018-10-10 18:03:03 -04:00
|
|
|
```
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
你的代码中不应包含`div`标签。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
```js
|
|
|
|
assert($('div').length == 0);
|
|
|
|
```
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
你代码中的`footer`应该是闭合的。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
```js
|
|
|
|
assert(code.match(/<footer>\s*© 2018 Camper Cat\s*<\/footer>/g));
|
2018-10-10 18:03:03 -04:00
|
|
|
```
|
2020-02-11 17:06:41 +08:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --solutions--
|
|
|
|
|