CSS code isn't working

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/web-beginner-en-WF0CF/1/4?curriculum_id=50579fb998b470000202dc8b#

<In what way does your code behave incorrectly? Include ALL error messages.>

Oops, try again. Did you remember to bold the introduction and summary paragraphs?

p {
font-family: Garamond;
}
p1 {
font-weight: bold;
}
p5 {
font-weight: bold;
}

p2 {
color:#7ac5cd;
}
li p {
color:#000000
}

```

Replace this line with your code.

<do not remove the three backticks above>

Have a look at the instructions again… p1, p2, p3 isn’t going to work

div > p { /* Some CSS */ }

This only grabs `<p>`s that are nested directly inside of `<div>`s; it won't grab any paragraphs that are, say, nested inside lists that are in turn nested inside `<div>`s.

This is all new to me, BRAND new! Thanks for the tip. I finally figured out I needed div > I just have no clue why

1 Like

Let me explain to you quickly,

<div>

  <ul>
     <li>
        <p>Some text in a paragraph in a list in a div</p>
     </li>
  </ul>

  <p>Some text in a paragraph in a div</p>

</div>

Have a close look at the above code.

p{
color:red;
//this will select all paragraphs to be red
} 

div > p {
color: red;
//this will select paragraphs that are directly under div(so div in list won't be selected) 
} 

//I hope you understand now :) 

Okay yeah that makes sense, thank you sir!

1 Like