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 file won't work in index.html.

I am currently working through the "How to make a website" tutorial. I am working on the CSS session, and I can't get the main.css file to import into the index.html file. I have checked it several times for mistakes and typos and I can't find any. Does anyone have any suggestions or had this same problem?

Thanks

Paste your code here to see if I can debug the problem.

Here is what I have entered.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Nathan St. Clair | Photographer</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
  </head>
  <body>

Hi, I went ahead and edited your post to fix how your code should be displayed take a look below and/or look at the markdown cheatsheet below every forum post.

How to Post Code to the Treehouse Forum

1 Answer

If your files are under the same directory as your html remove css/ just write down the normalize.css.

If you have then a directory up add ../ before css/normalize.css

For example

Within the same folder, just use the file name:

href="thefile.html"

Within a super-directory:

href="../thefile.html"

Within a sub-directory:

href="subdir/thefile.html"