Linking html and css


#1

After watching countless tutorials, i cannot get my html and css file to link properly. I am trying to get my h1 to change color though a class in my css file, but html will not connect with css. I tried using online compilers as well as downloading the atom text editor. I did the exact same thing as the many videos I watched and the websites I’ve been to. Doesn’t work. I am very frustrated. My last post about this got all disorganized so that is why i am posting this twice if you noticed. Could some please help me with this. This is my code in the atom text editor:


#2

Hi,

the code looks good to me.

Did you check if the index.html and the style.css are on the same level in your folder structure?
Like:

  • index.html
  • style.css

In case you put the style.css in another folder your href syntax should be something like: foldername/style.css

  • index.html
  • foldername
    • style.css

A quick tipp:

You can open the Network Monitor (MDN) in your Browser and check after reloading the webpage. click on your css file in the window and check the info about the “Requested URL”. That is the (absolute) path to your css file.

I hope it helps you. :slight_smile: