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 link css file to html file?

I'm using Komodo Edit 8.5 (free) and this is my first time trying to make a page from scratch and I'm so frustrated by the fact that I can't get my stylesheet to link!

Could someone check my code to see if anything's wrong? http://codepen.io/anon/pen/EblmK

and yes, I've checked a million times to make sure my css file is called "main". No typos, no capitalization. Just clearing that up now since I'm sure that's the first question I'll be asked haha.

1 Answer

Hi Aleksandra Agosto

Your code that looks like this:

<link rel="stylesheet" href="C:\Users\Aleksandra\Desktop\NJAA\css\main.css">

It should just be something like this:

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

No, that didn't work :/

No idea why, but it randomly started working without me doing anything! haha thanks anyways!

No problem :D