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

General Discussion

Main.css not linking to index.html

Hello, I've been working on How to make a website and when i got to CSS everything was fine until i had to link main.css to index.html. Can anyone help me, I've tried almost everything and don't know what's wrong. Here's my code.

<head>
    < meta charset="utf-8" >
    < title>Daniel Gonzalez | Designer</title >
    < link rel="stylesheet" href="css/normalize.css" >
    < link rel="stylesheet" href="css/main.css" >
  </head>

5 Answers

try adding this in

type='text/css'
Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Daniel,

Thanks for posting your code! Linking CSS should follow this form.

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

As obvious as it may be, make sure that the href is correct and that your HTML is relative to the CSS folder. In this case, your HTML file should be located in the same directory as the CSS folder. Otherwise, you're HTML file will look for the CSS folder but not be able to find it.

I hope this helps.

@Garrett Goehring Where exactly do i insert the type="text/css" ?

within the link tag after the rel part

Something was wrong with the folder. I fixed it, but thank you for your advice.