--- id: bad87fee1348bd9aede08835 challengeType: 0 videoUrl: 'https://scrimba.com/p/pVMPUv/cNW4kC3' forumTopicId: 18246 title: 元素嵌套 --- ## Description
div元素,也叫 Content Division Element(内容划分元素)元素,是一个包裹其他元素的通用容器。 它也是 HTML 中出现频率最高的元素。 和其他普通元素一样,你可以用<div>来标记一个div元素的开始,用</div>来标记一个div元素的结束。
## Instructions
把无序列表、有序列表和段落都嵌套进同一个div元素。 提示:你可以在第一个<p>之前插入div开始标记,在</ol>之后插入div结束标记,这样,所有的列表都位于div之内。
## Tests
```yml tests: - text: '把所有的p元素嵌入div元素中。' testString: assert($("div").children("p").length > 1); - text: '把ul元素嵌入div元素中。' testString: assert($("div").children("ul").length > 0); - text: '把ol元素嵌入div元素中。' testString: assert($("div").children("ol").length > 0); - text: '确保div元素有结束标记。' testString: assert(code.match(/<\/div>/g) && code.match(/<\/div>/g).length === code.match(/
/g).length); ```
## Challenge Seed
```html

CatPhotoApp

点击查看更多猫咪图片

一只仰卧着的萌猫

猫咪最喜欢的三件东西:

  • 猫薄荷
  • 激光笔
  • 千层饼

猫咪最讨厌的三件东西:

  1. 跳蚤
  2. 打雷
  3. 同类


```
## Solution