--- id: bad87fee1348bd9aecf08801 title: HTML5 元素介绍 challengeType: 0 videoUrl: 'https://scrimba.com/p/pVMPUv/cBkZGpt7' forumTopicId: 301097 --- # --description-- HTML5 引入了很多更具描述性的 HTML 元素,例如:`header`、`footer`、`nav`、`video`、`article`、`section` 等等。 这些元素让 HTML 更易读,同时有助于搜索引擎优化和无障碍访问。 `main` 元素让搜索引擎和开发者能很快地找到网页的主要内容。 举个例子,下面的 `main` 元素嵌套了两个子元素: ```html

Hello World

Hello Paragraph

``` **提示:**在后面的应用无障碍课程中我们会接触到更多新的 HTML5 元素,以及明白它们的用处。 # --instructions-- 请在现有的段落之后创建一个新的段落,段落内容为:`Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.` 然后,请添加一个 `main` 元素,作为现有的两个 `p` 元素的父级元素。 # --hints-- 页面中应该有两个 `p` 元素。 ```js assert($('p').length > 1); ``` 每个 `p` 元素都应有结束标签。 ```js assert( code.match(/<\/p>/g) && code.match(/<\/p>/g).length === code.match(/

\s*?

/g)); ``` `main` 的结束标签应位于第二个段落之后。 ```js assert(code.match(/<\/p>\s*?<\/main>/g)); ``` # --solutions--