Be Brav3

FCC Challenge 35: Nest Many Elements within a Single Div Element

March 15, 2016

In Free Code Camp Challenge 35 we learn to nest elements within div elements.

The div element, also known as a division element, is a general purpose container for other elements.

The div element is probably the most commonly used HTML element of all. It’s useful for passing the CSS of its own class declarations down to all the elements that it contains.

Just like any other non-self-closing element, you can open a div element with [html]

[/html] and close it on another line with [html]
[/html].

Try putting your opening div tag above your “Things cats love” p element and your closing div tag after your closing ol tag so that both of your lists are within one div.

Nest your “Things cats love” and “Things cats hate” lists all within a single div element.

The original code is below:

[html]

CatPhotoApp

Click here for 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
[/html]

The updated code with div elements is below:

[html highlight=”33,46″]

CatPhotoApp

Click here for 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
[/html]