0
Why isn't my css being applied???
I put both the html and the css files in the same page, the name of the css file is style.css, and then in the html file I put the link <link rel="stylesheet" href="style.css" >
4 Respuestas
+ 3
If you can provide the code we could assist you much better ,if it's on sololearn platform then you don't need to do that ,if you are applying an external sheet they should be in same folder or provide the correct path
+ 3
You may need to add the directory path relational operators in your href path depending on the operating system of the machine you're trying to run the html page on.
Where;
. = same directory
and
.. = up 1 directory
So if the html file and the css file are in the same directory then you would use
href="./style.css"
if you had the css in a directory that is adjacent to the directory in which the html was in you would need to go up 1 directory and then into that folder like
href="../CSS/style.css"
if the css was in a sub directory of the html directory then you would use.
href="./CSS/style.css"
+ 2
you probably didn't put the <link rel... /> between the <head> tags of the html file, but can't quite tell from your details.... an example of your code would help a lot
+ 2
Thanks guys! I was able to solve my problem, it was due to the name of the file, it an extra ".css" for some reason, thank you so much