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 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.