How to correctly assign paths linking HTML files and CSS files?
P粉926174288
2023-09-03 20:30:26
<p>So I have a folder on my desktop called "Project 1" with two other folders in it, one called "HTML" which has my HTML files in it and another called "CSS" , which contains my CSS files. How to link HTML file to CSS with pathname? </p>
reh!
If this is your folder structure:
Then in
index.html
you need to link it like this:<link href='../CSS/style.css' rel='stylesheet' />
This is a relative path, so starting from
index.html
you have to go up one level (../
) and go into the CSS folder (CSS/
) and select the file (herestyle.css
).