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 Accessibility Websites CSS: Part 1

Daniel Politz
Daniel Politz
6,338 Points

My CSS styling won't apply to my HTML document

I cannot make the stylesheet apply to the HTML doc. I have them in the same location. the html doc is saved as an .html doc and the css doc is saved .css.

<!doctype>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Widget, Inc.</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body> 
    <div id="wrapper">
      <div id="header">
         <h1>Widget</h1>
         <ul id="nav">
            <li><a href="daniel.html">Home</a></li>
            <li><a href="#">Product</a></li>
            <li><a href="#">Company</a></li>
            <li><a href="#">Blog</a></li>
         </ul>
       </div>
body { 
     margin: 0;
     font-family: verdana, sans-serif;
     font-size: 0.85em;
     background: #eac657;   
 }
Tommy Gebru
Tommy Gebru
30,164 Points

Hey Daniel, Did you find everything ok?

3 Answers

Vrund Patel
Vrund Patel
11,994 Points
<!doctype>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Widget, Inc.</title>
  <link rel="stylesheet" type="text/css" href="(include folder where this file is)/style.css">
</head>
<body> 
    <div id="wrapper">
      <div id="header">
         <h1>Widget</h1>
         <ul id="nav">
            <li><a href="daniel.html">Home</a></li>
            <li><a href="#">Product</a></li>
            <li><a href="#">Company</a></li>
            <li><a href="#">Blog</a></li>
         </ul>
       </div>

Check the suggestion i made in href="", hope it works for you.

Is the CSS file linked up with the correct path (a correct href)? A nice way to find this kind of broken resources is via the chrome devtools. http://teamtreehouse.com/library/website-optimization

Etienne Fichot
Etienne Fichot
18,846 Points

Yeah same probleme here that's weird... i copy and paste the index.html folder of the finish project, it's works.