Reputation: 8937
My folder structure:
de/
index.html
en/
index.html
hu/
index.html
img/
image.png
style/
stylesheet.css
How can I link to the css file in the style
folder & the image in the img
folder within the html file inside the de
folder, whithout having to type the entire hostname like http://myhost.com/style/style.css
?
Is it even possible?
Upvotes: 0
Views: 135
Reputation: 489
you don't have to type the domain, you should use
<link href="/style/stylesheet.css" rel="stylesheet" type="text/css">
but dont forget the first /
as this will mean that the address is on the same domain as the page.
this will also save you from maintenance problems if you ever change the directory structure of your website.
Upvotes: 1
Reputation: 41
The css file can be link in the html file as
<link href="../style/stylesheet.css" rel="stylesheet" type="text/css">
Upvotes: 1