--- id: bad87fee1348bd9aede08835 title: Nest Many Elements within a Single div Element challengeType: 0 videoUrl: '' localeTitle: 在单个div元素中嵌套许多元素 --- ## Description
div元素也称为除法元素,是其他元素的通用容器。 div元素可能是所有人中最常用的HTML元素。就像任何其他非自闭元素一样,您可以使用<div>打开div元素,然后使用</div>其关闭到另一行。
## Instructions
嵌套你的“猫喜欢的东西”和“猫讨厌的东西”列出了一个div元素。提示:尝试将您的开始div标记放在“Things cats love” p元素上方,并将结束的div标记放在结束的ol标记之后,这样两个列表都在一个div
## Tests
```yml tests: - text: 将p元素嵌套在div元素中。 testString: 'assert($("div").children("p").length > 1, "Nest your p elements inside your div element.");' - text: 将您的ul元素div元素中。 testString: 'assert($("div").children("ul").length > 0, "Nest your ul element inside your div element.");' - text: 将您的ol元素div元素中。 testString: 'assert($("div").children("ol").length > 0, "Nest your ol element inside your div element.");' - text: 确保你的div元素有一个结束标记。 testString: 'assert(code.match(/<\/div>/g) && code.match(/<\/div>/g).length === code.match(/
/g).length, "Make sure your div element has a closing tag.");' ```
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


```
## Solution
```js // solution required ```