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 Use ID Selectors

Connecting my main.css to my index.html

I'm having a dificult time connecting my main.css file to my index.html. The code looks right on my .html file, so I'm having a hard time figuring it out. Any help would be greatly appreciated. Thanks! <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css">

3 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi Austin, first I would check that you have your main.css file in a folder called css, second I would check the spelling of these folders/files to make sure you have spelled them correctly (this has tripped me up a number of times), third I would try adding a type attribute in the link, like so:

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

Hope that helps!!

I found the issue, the folder name was CSS, whereas my reference point was "css/main.css". I went ahead and changed the folder name to css, fixing the issue. Thanks!

Grace Kelly
Grace Kelly
33,990 Points

awesome stuff!! glad you've fixed the issue :)

Kevin Korte
Kevin Korte
28,149 Points

Based off of that code, you need to make sure that at the same directory level as you index.html file that has this code, you have a folder called "css", and inside of that folder you have a file called "main.css".

I do have my main.css in the css folder with my index.html outside on the same directory level as the css folder.

Kharym Rasool
Kharym Rasool
1,453 Points

DUDE! The CSS to css folder name change FINALLY fixed my problems, ahhhh at last! thanks a bunch