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 ID Selectors

Chantal Baxter
Chantal Baxter
Front End Web Development Techdegree Student 4,858 Points

What's the difference between #main-footer and .main-footer in CSS?

In project 1, I used .main-footer or .anything. I didn't use the pound sign at all. What's the difference?

1 Answer

. is a representation of class and # for id.

If you have 2-3 element with common styles the choice should be class selector in that case but if you have only one element with different than id will be best option

Check out more