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 trialRobert Kohan
3,216 Pointslinking css style sheet
I am working on how to make a website and cannot get my css to link to my page. I think I have everything correct. It just isn't working. I will try to paste my code below to see if anyone can find my error.
Thanks
Jonathan Grieve
Treehouse Moderator 91,253 PointsI changed your comment just to make the code stand out with forum markdown. Check out the cheatsheet below for how to do it. :-)
5 Answers
Joshua Britton
10,252 PointsThanks for sharing your workspace.
I noticed 2 things: 1) Your CSS folder is in all caps rather than lower case (this made a difference when I viewed your workspace) 2) Your CSS code for the #wrapper had a slight error:
a {
text-decoration:none;
}
#wrapper {
max-width: 940px;
margin: o auto; /* <--- The "o" is the letter o rather than 0 :D (correcting this should help) */
}
Jonathan Grieve
Treehouse Moderator 91,253 PointsThe HTML looks kosher to me. :-)
I would therefore suggest you check the CSS files are in the right location. Remember when you specify the path to the files it is relative to the location of the HTML file. So you're saying the files are in a CSS directory which is at the same directory as your HTML file.
Steven Parker
231,261 PointsThere are no obvious problems in the code you have shared.
Is the stylesheet in question "main.css"? Your link points to it in the "css" folder. Is the file actually in that folder?
For more accurate analysis, you can make a snapshot of your workspace and post the link to it here.
Robert Kohan
3,216 PointsHere is my workspace
Robert Kohan
3,216 PointsThanks so much. The all caps of the file was the big problem. All good now!!!
Robert Kohan
3,216 PointsRobert Kohan
3,216 Points