ARTICLE AD BOX
So I have an html file and a css file (shortened examples shown here) and for some reason when I open the html file the css file does not run and there are also no errors in the console. I have tried looking at several different answers to similar questions but none of them are changing anything. The two files are in the same folder.
index.html <!DOCTYPE html> <html> <head> <link res="stylesheet" type="text/css" href="./style.css"> </head> <body> <h1>Hello World</h1> </body> </html> style.css h1 { text-align: center; }I am using chrome and the files are stored locally on the computer
11 silver badge4 bronze badges
2
Your CSS isn’t loading because of a typo in the <link> tag.
You wrote res instead of rel. Browsers don’t throw an error for this, they just ignore the stylesheet.
Fix:
<link rel="stylesheet" href="./style.css">After correcting that, refresh the page (Ctrl + F5) and the CSS will apply.
1 Comment
the correct code is "<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <h1>Hello World</h1> </body> </html>" there is the typo error in it and the "rel" is not written, the page is not having the css applied in it.
New contributor
Adnan_Abid is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Explore related questions
See similar questions with these tags.

