Css and Html linking problem


#1

Hello everyone

Currently I’m trying to learn html and CSS so I’m using sublime text to create a website as that would improve my skills but for some reason when I try to link html to css it doesn’t link for some strange reason. I’m using link <rel=“stylesheet” type=“text/css” href="/css/site.css" >
Folders file locations are main folder -> html -> index.html and my css are located main folder -> css -> site.css
I would really appreciate your help as this is driving my nuts…


#2

Did you mean to write,

<link rel="stylesheet" ...>

?

If you are working on your local machine one would assume your css folder is not on the system root but in a user documents folder. Don’t use an absolute address, but instead,

"css/site.css"

assuming the css folder is in the same directory as index.html. If this is on a host server facing the web, then it would make sense that the css folder is on the site root, so "/css/site.css" would be appropriate.