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 trialKevin Afsari
4,269 PointsHELP! None of my IDs or Classes Work!
Hello I've recently come to the conclusion that none of IDs or Classes work in my CSS. I've even deleted old ones that previously work and to no effect. The page still seems the same even after i delete vital CSS. What is going on, is it with Treehouse or my computer? Thank you! Also, I'm very very new, and I have no idea how to properly refer/upload my HTML/CSS. If there's a guide for noobs I'd gladly read it!
2 Answers
Philip Cox
14,818 PointsHi Kevin. As Slavik has suggested above, have you checked you have your <link> tag inside the <head>? The link tag refers to your main.css doc. link rel="stylesheet" href="css/main.css"
The path I wrote is presuming you have your index.html inside your main project folder. Your css doc inside a folder named css, also inside your main project folder. This will tell your .html doc that you are referencing an external .css document for your styles.
Another easy mistake to make, is forgetting to place a hash/pound # or a period . before your class or ID name. An ID will have a # before it. And a class will have a period before it. #element { color: white; } .class { color: red; }
Hope this helps you :)
Slavik Ostapenko
Courses Plus Student 12,480 PointsYou need to make sure that your HTML and CSS are "connected". In your HTML you have to add reference for a stylesheet <LINK href="mysytlesheet.css" rel="stylesheet" type="text/css">
If you don't have that in your HTML, it wouldn't know wheather it needs to refere to any stylesheet or not.