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.

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.