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 CSS Basics (2014) Basic Selectors Reusing Classes

Multiple selectors vs. Multiple classes

Is there a preference for using multiple classes in your html vs using multiple selectors for the same rul in your css file?

I would prefer to code something like this:

.primary-content, .secondary-content, #main-footer{ border-top: 2px solid lightgrey; }

To me that seems more explicit than a special class, and also keeps me from having to add extra code into my html. However, I'm still fairly new to html and css having only made a handful of projects, so I am aware I may be missing something important.

TIA!