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

Class

why do we have to write first the contact-info class li and then only phone class? if I want to style phone class then can I just write .phone and style? will it work that way?

3 Answers

Calvin Nix
Calvin Nix
43,828 Points

Hey Ruslan,

Could you provide a code example of what you are referring to?

I believe the video is just showing how you are able to select specific elements.

Sorry for late reply. As you can see below there are two classes. Cant I just use phone classe to apply some styles. For instance: phone a { contact-info li.phone a { background-image: url(../img/phone.png); }

Why do I have to write contact-info class? Will it not work if i use phone class itself?

contact-info li.phone a { background-image: url(../img/phone.png); }

Calvin Nix
Calvin Nix
43,828 Points

Hey Ruslan,

Yes you could do that.

The video is just showing how you can pinpoint specific elements.