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

HTML How to Make a Website Adding Pages to a Website Add Iconography

Dylan Carter
Dylan Carter
4,780 Points

Question about the " .contact-info li.phone " concept

the reason we have to put the li before the .phone (or mail or twitter), is it because it does not start chain?

For example if I wanted to select phone directly, could I just use .phone {xx:yyy;}? or would it still need to be li.phone {yyy.xx;}?

2 Answers

Steven Parker
Steven Parker
231,072 Points

The selector li.phone will target all list items that have the class phone. If you use just .phone as a selector, it will target every item (of any kind) that has the class phone.

Now, whether that makes a difference to your page display will depend on whether there are any other elements with that class. If no other elements have that class, it won't make any difference.

Marco Boretto
Marco Boretto
29,821 Points

it depends if you want specifically add styles to a li element with a class .phone otherwise if you want generally apply the style to all the elements sharing the .phone class just use .phone { xx:yyy}