Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website CSS: Cascading Style Sheets Take a Mobile-First Approach

ID's don't work

ID's are only allowed to be used once. What do you use in the place of ID's? divs, class, or is there something else? In Sublime Text 3, it won't read the code.

2 Answers

Devin Scheu
Devin Scheu
66,191 Points

You use classes in place of id's if you want more that one. :)

If IDs are not working, you might want to be sure that you've saved your file with a .CSS extension. Or, if you're working with HTML, with an html extension. If this is not the problem, then be sure that you're using a pound (hash) sign to target IDs and a period to target classes.

A div cannot be used in place of an ID; they are very different things. In fact, a div can HAVE an id. Please post your code if this does not help you.