Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

Kasper Braun
Kasper Braun
198 Points

It will not link the style sheet for main.css?

When I´ve added this line of code into my index.html: <link rel"stylesheet" href="css/main.css">

It doesen´t seem to work, when i try to put this line of code into the main.css:

body {

background-color: orange; }

6 Answers

Mate Vegh
Mate Vegh
25,607 Points

Hi! The line of CSS code you wrote is correct. There may be some trouble with the file path for the stylesheet. Post your index.html page here so we can help you out!

Hi Kasper,

try inserting this line of code into the head section of your index.html file:

<link rel="stylesheet" href="css/main.css" media="screen">
Kasper Braun
Kasper Braun
198 Points

Here is my index.html:

!DOCTYPE html> <html> <head> <meta charset="uft-8"> <title>Kasper Toft Braun | Designer</title> <link rel"stylesheet" href="css/normalize.css"> <link rel"stylesheet" href="css/main.css"> </head> <body> <header> <a href="index.html"> <h1>Kasper Toft Braun</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> </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> </li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> <li> <a href="img/numbers-06.jpg"> <img src="img/numbers-06.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> <li> <a href="img/numbers-09.jpg"> <img src="img/numbers-09.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> <li> <a href="img/numbers-12.jpg"> <img src="img/numbers-12.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> </ul> </section> <footer> <a href="#"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a> <a href="#"><img src="img/facebook-wrap.png" alt="Facebook Logo"></a> <p>© 2015 Kasper Toft Braun.</p> </footer> </body> </html>

Kasper Braun
Kasper Braun
198 Points

Sorry. The doctype does of course look like this:

<!DOCTYPE html>

Remember to include the equals sign after rel. Heres how your code should look:

<!DOCTYPE HTML>
<head>
<meta charset="uft-8">
<title>Kasper Toft Braun | Designer</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
</head>

<header>
  <a href="index.html">
    <h1>Kasper Toft Braun</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>
  </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>
    </li>
    <li>
      <a href="img/numbers-02.jpg">
        <img src="img/numbers-02.jpg" alt="">
        <p>Experimentation with color and texture.</p>
      </a>
    </li>
    <li>
      <a href="img/numbers-06.jpg">
        <img src="img/numbers-06.jpg" alt="">
        <p>Experimentation with color and texture.</p>
      </a>
    </li>
    <li>
      <a href="img/numbers-09.jpg">
        <img src="img/numbers-09.jpg" alt="">
        <p>Experimentation with color and texture.</p>
      </a>
    </li>
    <li>
      <a href="img/numbers-12.jpg">
        <img src="img/numbers-12.jpg" alt="">
        <p>Experimentation with color and texture.</p>
      </a>
    </li>
  </ul>
</section>
<footer>
  <a href="#"><img src="img/twitter-wrap.png" alt="Twitter Logo"></a>
  <a href="#"><img src="img/facebook-wrap.png" alt="Facebook Logo"></a>
  <p>&copy; 2015 Kasper Toft Braun.</p>
</footer>

Just a simple typo error

Kasper Braun
Kasper Braun
198 Points

Wauw. That error. Thank you so much for helping me!

No problem! Happy to help!