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 trialJason Ruby
2,867 Pointsfooter a {} versus .social-icon{}
Nick stated that declaring class="social-icon" in the anchors of the footer was done to show how a class can be used multiple times on a given page as opposed to declaring a single unique ID. He stated that when modifying the the footer we could have simply referenced the anchors nested within the footer (e.g. footer a {}). I had this thought prior to watching the video and tried it, but it didn't work so I assumed I had done something incorrectly. Then Nick said the same thing in the video, so I tried it again:
footer a { width: 20px; height: 20px; margin: 0 5px; }
It did not produce the same results as:
.social-icon{ width: 20px; height: 20px; margin: 0 5px; }
Why?
3 Answers
Shawn Denham
Python Development Techdegree Student 17,802 Pointswith the footer a {} you are targeting every link the footer.
with .social-icon {} you are targeting only the elements that have the class of "social-icon".
Does that answer your question?
Jason Ruby
2,867 PointsThanks, Shawn. That makes sense.
Nathaniel Simone
4,608 PointsI think the issue is that the social-icon class was applied to the image elements not the anchor elements. If you used footer img {} instead of footer a {} it should work the same as .social-icon {}.
Shawn Denham
Python Development Techdegree Student 17,802 PointsShawn Denham
Python Development Techdegree Student 17,802 PointsI will add that it would be eaiser if we could see the html and css code you are talking about. you can check the markdown cheatsheet at the bottom of this page to see how to post code in to the forums.