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 CSS Foundations Getting Started with CSS Adding CSS to a Page

Matthew Clark
Matthew Clark
7,255 Points

Problem Showing Css?

Hi-

I added in my css in my separate sheet using sublime text, but when I refreshed it on the browser it did not show up. I have the file saved in my documents on my computer in a folder named treehouse. Inside that folder I added a CSS folder with my style.css and more-styles.css.

Here is how I linked it on my index.html:

<link rel="stylesheet" href="css/style.css">

Any thoughts on what is going wrong?

Adam Moore
Adam Moore
21,956 Points

The code didn't quite show up, you may have to use the Markdown Cheatsheet below as a guide.

Matthew Clark
Matthew Clark
7,255 Points

What is the markdown cheatsheet?

Adam Moore
Adam Moore
21,956 Points

It's just below the comment and answer text area.

If it's not appearing as markdown, you may be using commas. Copy and paste these symbols instead ```

2 Answers

Be sure you're linking to your CSS document like so:

<link rel="stylesheet" type="text/css" href="css/style.css">
Dave Berning
Dave Berning
17,365 Points

Matthew Clark like '''<!doctype html>''' otherwise it won't know how to read the HTML document properly and ultimately link you CSS.

Are you using a "reset stylesheet" if so, make sure your reset.css is referenced in your HTML <head> BEFORE your other style.css and more-styles.css files. If your reset stylesheet isn't the first style sheet referenced then it will overwrite any custom CSS, because its doing its job. Hope this helps.

One last thing...you say your site is in a "threehouse" folder and in that you have a "css" folder. Make sure your index.html page is inside the treehouse folder with the style.css in the css folder.

With a proper file structure and reset stylesheet your link tags should look like this...

<link rel="stylesheet" type="text/css" href="css/reset.css"><!-- reset stylesheet goes on the very top -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/more-styles.css">