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

Pranav Mathur
Pranav Mathur
3,419 Points

What if instead of specifying the whole path, " .contact-info li.phone a {}". I just use this, " .phone a {}"?

Would I be wrong if I just use, " .phone a {}" as my selector?

1 Answer

Cory Harkins
Cory Harkins
16,486 Points

You can do that.

The complexity of your selectors are dictated upon your intended targets, if you have 2 phone lists one for in-country numbers, and another for say out of country numbers, perhaps you wouldn't want to target all classes of phone, and the anchor elements within.

in your selector it will select all anchor elements within an element of the class .phone. So that's pretty broad.

Perhaps you have contact-info for your companies employees and within you have a class of .phone for the li's, and then you have a sister companies contact-info that you want to ensure is different but has a class of .phone for the li's as well.

Hope that helps to give an instance of use.