--- id: bad87fee1348bd9aede08835 title: 1 つの div 要素に多くの要素をネストする challengeType: 0 videoUrl: 'https://scrimba.com/p/pVMPUv/cNW4kC3' forumTopicId: 18246 dashedName: nest-many-elements-within-a-single-div-element --- # --description-- `div` 要素は、division (分割) 要素とも呼ばれ、他の要素を入れる入れ物として汎用的に使われます。 `div` 要素はおそらくもっともよく使われる HTML 要素です。 終了タグを必要とする他の要素と同じように、`div` 要素は `
` で開始し、別の行で `
` で終了します。 # --instructions-- "Things cats love" と "Top 3 things cats hate" のリストを全て、1 つの `div` 要素の中にネストしてください。 ヒント: "Things cats love" の `p` 要素の上に `div` の開始タグを、`ol` の終了タグの後に `div` の終了タグを配置して、両方のリストが 1 つの `div` の中に入るようにしてください。 # --hints-- `p` 要素は、`div` 要素の中にネストする必要があります。 ```js assert($('div').children('p').length > 1); ``` `ul` 要素は、`div` 要素の中にネストする必要があります。 ```js assert($('div').children('ul').length > 0); ``` `ol` 要素は、`div` 要素の中にネストする必要があります。 ```js assert($('div').children('ol').length > 0); ``` `div` 要素には終了タグが必要です。 ```js assert( code.match(/<\/div>/g) && code.match(/<\/div>/g).length === code.match(/
/g).length ); ``` # --seed-- ## --seed-contents-- ```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


``` # --solutions-- ```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


```