Newbie unable to link css file to html

Hey everyone,

I am starting my first project and already cannot link my css file to html file successfully in VSCode. I removed the period in front of the file which allowed the text editor to find it, but it still won’t link. Here is what I have for both (these are just copy/pasted from my lesson in codecademy btw, I didnt write these):

<!DOCTYPE html>
        <link href="/resources/css/index.css" type="text/css" rel="stylesheet">
        <title>James Gray Beginner Coding</title>

and my stylesheet is as follows:

* {
    font-family: Helvetica, Arial, sans-serif;
  h1 {
    color: SeaGreen;
  li {
    font-size: 18px;
  a {
    text-decoration: none;

None of these features appear to be present on the webpage. Again my file directory is exactly as Codecademy has instructed. Please help!

Ok so I got it work but only by going totally against what Codecademy is teaching me to do.

Moved my index.css file into the same folder as my index.html and cut the href link to just “index.css” and it worked. That is the only way I could get this to work and Im proud and everything but, how do I link files from other folders successfully? Ill keep trying but this is concerning.

since you were using /resources/css/index.css, I’m assuming your index.css file was inside a folder named css, and that folder was inside another folder called resources ?

The solution was removing the “./” from the beginning of the image reference. It worked totally fine after that in the directory style they taught me. Thanks for responding

1 Like

I’m having the same issues, and even after changing things the way you did (which VS finally seemed to catch onto the file path which was more than anything else I’ve tired! ) I still can’t get my CSS to link to my HTML when I run the HTML. I’ve tried moving it into different folders and moving it out of different folders and I’m so lost at this point. I’ve searched stack overflow, reddit and codecademy. This is one of the only discussions on this that I have been able to find that isn’t archived. Can someone please help me?
This is what my current code looks like and I tried to capture what the filetree looks like as well:

Can someone please, please help? I don’t know where to go from here

I would remove the “/” at the beginning of “/stylesheet1.css” in your link element. I have found this is unnecessary in every instance of linking stylesheets since I started here, files in the same folder don’t need that forward slash.

Also, are there 2 pages of that same stylesheet? Im not familiar with having that number next to my stylesheets, but I am still a novice. Still I thought I would raise that concern.

I hope some of this helps!

I tried this, and it still won’t render with any of the CSS, unfortunately.

As for adding a 1 at the end, I did have another stylesheet open on VS when I started because I was playing around with a few of the things I had learned previously and that one was already titled “stylesheet.css” . My computer wouldn’t let me save a second sheet with the same name without overwriting the first. I never could figure out how to connect the two files for that test either, but it became a massive point of frustration when I moved on to the actual Dasmoto Project.

Thank you for the suggestion!