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

CSS CSS Basics (2014) Basic Selectors Descendant Selectors

Michael Pashkov
Michael Pashkov
22,024 Points

Hi guys! Why li doesnt turn white? li remains blue.

ul li {
background-color: tomato;
  color: white;
  margin-bottom: 5px;

 }

 Lake Tahoe is full of wonderful places to stay. You have the ability to sleep in the outdoors in a tent, or relax like a king at a five star resort. Here are our top three resorts:

    Lake Tahoe Resort Hotel
    South Lake Tahoe Resorts
    Tahoe Ski Resort Lodging


<ul>
        <li><a href="#">Lake Tahoe Resort Hotel</a></li>
        <li><a href="#">South Lake Tahoe Resorts</a></li>
        <li><a href="#">Tahoe Ski Resort Lodging</a></li>
      </ul>

Moderator edited: Markdown added so that code renders properly in the forums.

2 Answers

Ben Reynolds
Ben Reynolds
35,170 Points

Did the bullet points at the beginning of the list items turn white? To target the link text as well, you'll probably need a selector like this:

ul li a {
     /* styles */
}
Michael Pashkov
Michael Pashkov
22,024 Points

Thank you. Bullet turned white. But why li didnt?

Ben Reynolds
Ben Reynolds
35,170 Points

If the contents of the li was just plain text it would have turned white, but since it was wrapped with an <a> tag (which has its own default styling, the blue color) that element's css needs to be specified as well.