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 trial

CSS How to Make a Website Styling Web Pages and Navigation Polish the Navigation and Footer

Classes

Where could I find more information about the classes? The way how ".social-icon" was used instead of some other way of styling the icons is not quite clear.

3 Answers

Errol Ikalina
Errol Ikalina
353 Points

For example classes are sometimes used instead of IDs because you can have multiple classes in one page whereas you can only have one ID per page. For example, if you want to apply a setting to several elements in one go you would use class and apply the class to all of them and the settings will be applied to all elements that has that particular class name. Ids on the other hand can only appear once on a page and is particular to one element. You can have many IDs but no IDs can have the same name.

Hope this helps a bit.

Thanks, this helped a lot.

Thanks, this helped a lot.