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 trialJAKZ AIZZAT
7,813 PointsCss selector
Any different between :
.contact-info li.phone a{ background-image:url('../img/phone.png'); }
and
.contact-info .phone a{ background-image:url('../img/phone.png'); }
.contact-info li .phone a{ background-image:url('../img/phone.png'); }
2 Answers
Jason Anello
Courses Plus Student 94,610 Points.contact-info .phone a
has lower specificty than the first one but will still work on this project with no problems. Lower specificity because you've dropped 1 type selector.
.phone a
will even work too, at least for this project.
.contact-info li .phone a
will not work at all because there isn't an element with a class of "phone" nested within an <li>
The element with the class of "phone" is the <li>
So they have to either be combined li.phone
or use .phone
by itself
Kevin Korte
28,149 PointsOne says
"Set the background image of an anchor element, inside of an element with the class of phone, inside of a list item, inside of an element with the class of contact-info."
The other says "Set the background image of an anchor element, inside of an element with the class of phone, inside of an element with the class of contact-info."
Probably no difference in the browser, unless you had anchor elements inside elements with a class of phone, and some where inside list items, and others weren't.