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.

HTML Build a Simple Website Creating a Website Structure CSS Reset

CSS link

When I type out the code to link the CSS normalize file to my html it doesn't change anything. When I downloaded the documents from this page the normalize file was renamed "_.normalize.css" so I renamed it thinking that was the problem but it still hasn't changed. This is exactly what is in my html file between <head> and </head> : <link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen"> Any suggestions?

I have seen this question asked before in the forum but, because we are not able to type the code out here, someone offered to review it through email... Anybody have a few minutes?

9 Answers

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Yes, spot on.

<link rel="stylesheet" href="css/img/normalize.css" type="text/css" media="screen">

I recommend having your 'img' folder which is for images and your 'css' folder for your stylesheets separate from each other.

If you need any other help, just let me know

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hey Tracy,

If you show your HTML I will be able to help :D Please refer to the Markdown Cheatsheet to see how to show your HTML in the discussion.

Thanks

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi again Tracy,

You are certainly able to type code out here, you need to use the Markdown Cheatsheet like so:

<div id="html_example" class="example">
    <div class="nested_div">
        <ol>
            <li>List element</li>
        </ol>
    </div>
</div>
John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi again Tracy,

You are certainly able to type code out here, you need to use the Markdown Cheatsheet like so:

<div id="html_example" class="example">
    <div class="nested_div">
        <ol>
            <li>List element</li>
        </ol>
    </div>
</div>

Thanks! <link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Okay, would you be able to let me know the folder name that normalize.css is in?

Is it in your root directory or in a folder at all?

css -> img -> normalize.css So I have to add the img?

Sorry, it isn't in img. Its in the css folder that's all...

John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

Okay, make sure the link is in the head of your HTML.

<html>
    <head>
         <link rel="stylesheet" type="text/css" href="css/normalize.css">
    </head>
</html>

I've realized now that it isn't in the img folder, I was just confused when looking at it from the text editor. So it still hasn't changed... I noticed that in the rest of my code I had to write in the full location of the images that I downloaded from this site the same way and added. So instead of the css/normalize.css I tried this (and it should contain the opening so you can see if I've put it in the right place)

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Smells Like Bakin' Cupcake Company</title>
    <link rel="stylesheet" href="C:/Users/Tracey/Desktop/css/normalize.css" type="text/css" media="screen">
    </head>
<body>
    <img src="C:/Users/Tracey/Desktop/img/logo.gif" alt="Smells Like Bakin"/>
            ``` 
The image line underneath it works perfectly but this one still doesn't work.
John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Tracy,

I now know why this isn't working.

What you need to do, is create a directory for all your files. At the moment, you are just sourcing files from your Desktop.

  • Create a new folder that will be your directory eg "Smells Like Bakin" or whatever you want.
  • Put all your files so far inside this folder (index.html, 'img' folder, 'css' folder etc)
  • Then you can link to files within your directory like this:
<link rel="stylesheet" type="text/css" href="css/normalize.css">
or
<img src="img/logo.gif" alt="Smells Like Bakin">

Hope this helps :D