Saul Kriheli
Saul Kriheli

Reputation: 9

CSS file linking issue

Why is my CSS file not linked when the HTML file is inside a folder within the folder that contains both folders? I tried deleting the main folder address from the link and it still persists.

https://i.sstatic.net/Q1mWA.jpg

*The CSS file is OK and works only when the HTML file is not in a separate folder.

Upvotes: -1

Views: 34

Answers (1)

Diana Le
Diana Le

Reputation: 116

If you want to use the relative path to the CSS file, then the link href needs to be relative to your html file:

<link rel="stylesheet" href="../css/9a.css">

The .. indicates that you want to navigate outside the "html" folder where your html file is located, then find the "css" folder, then find your css file.

Upvotes: 1

Related Questions