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 How to Make a Website CSS: Cascading Style Sheets Style the Basic Elements

Why isn't my .css linking to my .html?

I had the same problem as that guy, but all the answers revolve around him showing his code correctly, rather than how to link the 2.....

a {
  text-decoration: none;

#wrapper {
  max-width: 940px;
  margin: 0 auto;

#logo {
  text-align: center;
  margin: 0;
Ben Dietrich
Ben Dietrich
8,287 Points


Can you add your html? The issue will reside in the head section of your index.html file. Thanks!

19 Answers

Oh, now i got it! You named the folder uppercase. Try this:

<link  rel="stylesheet" type="text/css" href="CSS/new.css">

The HTML has to link to the CSS, not vice versa. :) Can you post the HTML?

You can also try this:

<link rel="stylesheet" type="text/css" href="css/main.css">

<!DOCTYPE html> <html> <head> <meta charset="utf-8">
<title> Red G.Rick | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link href="new.css" rel="stylesheet" type="text/css">

</head> <body> <header> <a href="index.html"> <h1>Red's Place</h1> <h2>Designer</h2> </a> <nav> <ul> <li> <a href="index.html">Portfolio</a></li> <li> <a href="about.html">About</a></li> <li> <a href="contact.html">Contact</a></li> </ul> <ol></ol> </nav> </header> <section> <ul> <li>

      <a href="img/numbers-01.jpg">
       <img src="img/numbers-01.jpg" alt="">
       <p>Experimentation with color and texture</p>


      <a href="img/numbers-02.jpg">
       <img src="img/numbers-02.jpg" alt="">
       <p>Playing with blends in photoshop</p>
      </a> <li>

      <a href="img/numbers-06.jpg">
       <img src="img/numbers-06.jpg" alt="">
       <p>trying to create 80's styles of glow</p>
      <a href="img/numbers-09.jpg">
        <img src="img/numbers-09.jpg" alt="">
        <p>Drips created using Photoshop brushes</p>
      <a href="img/numbers-12.jpg">
       <img src="img/numbers-12.jpg" alt="">
       <p>Creating shapes using repetition</p>


  <a href="http://twitter.com/nickrp"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a>
  <a href="https://myspace.com/berbarkhan"><img src="img/myspace.jpeg" alt="Myspace Logo"></a>

  <p>&copy; 2014 Red G.Rick</p>



also tried

'''<!DOCTYPE html> <html> <head> <meta charset="utf-8">
<title> Red G.Rick | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link href="new.css" rel="stylesheet"> '''



'''<!DOCTYPE html> <html> <head> <meta charset="utf-8">
<title> Red G.Rick | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href=css/new.css"> '''

'''<html> <head> <meta charset="utf-8">
<title> Red G.Rick | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" type="text/css" href="new.css">

</head> <body>'''

Why do you link to new.CSS in stead of main.CSS?

Have you got a link for us?

new is what i called the file. in one forum the person fixed the issue by renameing the file, so I tried that as well.

Do you have a live testing URL? Maybe you can paste it at jsfiddle.net or upload it to a ftp?

would code bloacks be a LT URL?

Yes, maybe. Please post it here. What is Code Blocks? An IDE?

Post what? I'm not sure how to use jsfiddle, I just plugged the code in there though, and it's showing the headline centered and correct colors. I'm not sure how to show that to you, other than cutting and pasting it to here, and its the same code as above. I'm not sure whats wrong with my version of treehouse if it's not reading the same code the same way that jsfiddle does

Have you a xampp server installed? Or how do you develop on your computer? Do you use Chrome? My idea was to lookup at the developer tools network tab why it isn't working. P.S.: At JSFiddle, when you click save you can post the browser URL.

This is my first programing class, I dont have xampp installed, I don't know very much about computers, just getting started. I ran into this issue a couple weeks ago and have been bashing my head into it. I got tired of it and started a c++ tutorial that uses the code bloacks workspace, but I turned my attention back to treehouse because it syncs with my local employment office. PS http://jsfiddle.net/RedGRick/n012j92n/

You can also upload it to Treehouse Workspaces. This would be the easiest way.

My mistake... I forgot to say that you first have to click preview in the code editor and then post this link, because the one you posted was the private link :) Hopeful I'm not buggy

P. S. : Help for the preview: https://teamtreehouse.com/forum/i-just-practiced-creating-my-first-webpage-but-i-dont-know-how-to-preview-it-i-can-only-see-the-default

I dont see a preview option in fiddle, or treehouse, how bout this, its the "share" option in fiddle

http://jsfiddle.net/RedGRick/n012j92n/2/embedded/result/ http://jsfiddle.net/RedGRick/n012j92n/2/

Click the eye in the top right corner. Then a new site opens. I only need the link from the browser bar.

This is the right link. How does the file structure look like at workspaces/where did you save the css?(maybe a screenshot) I already tried the most possible css names but didn't find it.

I found it! Simply replace new.css with main.css Attention: This file is currently empty at workspaces.

I replaced new with main; still nothing on my end. I took a screen shot, how is the best way to sent you the .png?

Simply send it to me via email or upload it to imghost.us But I think the problem is that the main.css file is empty. Simply post your css into it.

yup! fixed it! Alternately, i decided to rename the folder "css"


Glad to help! To make it easier for others to find unanswered questions, please mark one Best Answer.