Recently, I encountered an issue with my CSS and HTML files. Initially, they were in the same folder on my desktop and the
<link rel="stylesheet" type="text/css" href="style.css" />
reference worked perfectly. However, I decided to organize my files into separate folders named HTML and CSS. Now, I updated the CSS link to <link rel="stylesheet" type="text/css" href="/CSS/style.css" />
. Oddly enough, this setup functions flawlessly on the Live Server in Visual Studio Code. Unfortunately, when I try to open the index.html file in a regular browser, the CSS file fails to link properly, along with the images stored in the img folder. I've attempted using href = "./CSS/style.css"
and href="/style.css"
, but to no avail. The frustrating part is that it only seems to work on the Live Server. Any assistance would be greatly appreciated!