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 trialDanielle Roderick
1,182 Pointshelp getting CSS file to link - what are the steps
I am doing the beginning CSS course. My work matches the download file but when I save and refresh in my browser the html is not corresponding to the CSS file & grids.
Have I missed some step here?
5 Answers
James Barnett
39,199 PointsSounds like you are having file path issues. I recommend you check out tutorial on file paths
Danielle Roderick
1,182 PointsI am using Chrome but just tried in Safari and same thing.
I suspect it is not linked correctly. All of the html content is fine, just none of the formatting.
I am new to all of this, can you explain how I inspect the page to see if I can get to the CSS?
Rajanand Ilangovan
3,226 PointsYou should link your css file in between the header section in your html file and make sure that you have included the correct path name to point the .css file. http://pastebin.com/9G32LFVY
Tommy Vidal
2,526 PointsI have also been having this same problem. I tried using ' href="css/style.css" ' as well as ' href="style.css" ' but for some reason neither of these work. I am using a MacBook Air with OS X Mountain Lion, Sublime Text 2 as my text editor and Safari as my browser.
Rajanand Ilangovan
3,226 Pointshi tommy, basically in "href" attribute you are giving the path to the respective file(in this case .css file). if you have placed the index.html and style.css file in the same folder you can use href="style.css" It will work just fine.
Tommy Vidal
2,526 PointsHi Rajanand,
I tried this with my stylesheet in a separate folder "css/style.css", but it did not work. The I put the stylesheet in the same folder as index.html (both located in a folder called "adding-css" but this did not work either. The only way I got it to work was when I put all the files directly on my desktop. I do not understand what I am doing wrong. Do you think the text editor I am using could be effecting this?
Rajanand Ilangovan
3,226 Pointsthere is nothing woring with the text editor you are using. "css/style.css" css is folder name and style.css is the css file name. i think you had different file name for the css file.
Danielle Roderick
1,182 PointsThanks Rajanand, I think that helped. I don't think I had the html file in the same holder.
Thanks all for your suggestions, much appreciated :)
Tommy Vidal
2,526 PointsI got it working now as well. Thanks for the help Rajanand.
Tommy Vidal
2,526 PointsThanks James. This was very helpful.
Alex Hedley
16,381 PointsAlex Hedley
16,381 PointsCan you post the code or CodePen so we can have a look?
If you inspect the page can you get to your css file, is it linked to the page correctly?
Are some parts showing up correctly?
Which browser are you using? Is it the same in all browsers?