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

Bob van Vliet
Bob van Vliet
1,826 Points

Is it also correct to add a .phone a {} instead of .contact-info li.phone a {} if you want to use it in this website?

I wonder in this example you don't use a .phone a {} instead of .contact-info li.phone {} if you use this phone image only for the contact page? Is this also correct?

3 Answers

In this particular case

.phone a {}

would work.

But what if later other lists with list items that have the class="phone" attribute are added to the page?

I believe Nick is following the practice here of being as specific as possible so that later additions to the page's html doesn't have unintended consequences.

Bob van Vliet
Bob van Vliet
1,826 Points

Thanks Jcorum! I thought so. Do you know a good website where you have CSS and HTML challenges?

Regards, Bob

w3schools has good pages on all the CSS selectors and the nice thing is that most of the pages have a Try It Yourself popup window where you can play around, change things, experiment.

http://www.w3schools.com/css/