Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript CSS Selectors Quickstart Pseudo-classes and Combinators Pseudo-classes Challenge

Stuck on Step 3. What am I missing?

Hello - I am stuck on Step 3. My code for Steps 1 to 3 are as follows;

Step 1 set first item in list to white - quiz said this is correct li: first-child { color: white; }

Step 2 set last item in list to azure - quiz said the cumulation of Steps 1 and 2 are correct li: last-child { color: azure; }

Step 3 set even number items in list to dodger blue - taking Steps 1 to 3 cumulatively, the quiz returns the comment "Are you setting the last item in the list to azure?". What am I missing here. Step 2 sets the last-child item to azure and it worked per above. li:nth-child(even) { color: dodgerblue; }

Thank you very much

Faith

style.css
/* Complete the challenge by writing CSS below */

li:first-child {
  color: white;
}

li:last-child {
  color: azure;
}

li:nth-child(even) {
  color: dodgerblue;
}
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Pseudo-classes Challenge</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <ul>
      <li>Papayas</li>
      <li>Avocados</li>
      <li>Pineapples</li>
      <li>Grapefruits</li>
      <li>Pomegranates</li>
      <li>Tamarinds</li>
      <li>Kiwis</li>
      <li>Lemons</li>
      <li>Bananas</li>
      <li>Tomatoes</li>
    </ul>
  </body>
</html>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Faith Wong! You're doing terrific! Step 3 is asking you to set the background color to blue. Not the text color. So you'll need:

background-color: dodgerblue;

Hope this helps! :sparkles:

Thank you Jennifer! Oh my goodness, silly oversight.

Thanks for your quick response.

Faith