0
HTML file path
Here's a situation I have a HTML file with name : template.html in folder named : html. I want to link a external css file named style.css which is located in folder named css to template.html . I want to do it using reative paths ( for now I strictly don't want to use absolute paths ) PS : Folder named css and html are inside same folder . Thanks in advance
6 ответов
+ 2
If I understood your explanation correctly, then perhaps you can try this;
<link rel="stylesheet" href="../css/style.css">
+ 1
Ipang I tried that path and it didn't worked
+ 1
Is your folder structure as follows?
. (base folder)
./css/
style.css
./html/
template.html
Maybe I didn't get the layout correctly ...
(Edited)
+ 1
Naveen K R I understand the same as Ipang and its code should works as is...
Are you sure that's the css file wich isn't correctly linked? Maybe you've some relative urls in your css code and you don't correctly link these ressources (they should be relative to the css file location, not the html file location)?
+ 1
Ipang yes
+ 1
Naveen K R
Create a new web code in SoloLearn. Put content of template.html file in HTML tab and put content of style.css file in CSS tab of the new code. Then share the link here.. Maybe that way things can become clearer.