Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
STAFF
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