Why css file won't link


When I try to debug my html file with css attached as below:

*{ margin: 0;
padding: 0;}

the css doesn’t make the written adjustments.

I have tried to write css/ where my href is and I have tried deleting browser history and I have also removed type=“text/css” to see if that is the issue, but I still haven’t managed to link the file properly.

Any help would be appreciated.

Hi there!
Your link element href value should be same as your css file name.

I think that I have done that correctly. The css file name is winterwear4u.css and I have written in my href attribute “winterwear4u.css”
Is it an issue with the editor (Visual Studio Code)?

Your HTML file would have to be inside the same folder as the CSS file for that to work. Otherwise, you have to navigate to the CSS file in the path, by going in or out of folders.

For example:

<link rel="stylesheet" href="./css/styles.css" />

Please post your folder structure.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.