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 trialPranav Mathur
3,419 PointsWhat 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
16,500 PointsYou 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.