This is the file Tree:
-page folder
--main.html
--style.css
--english
---hello.htm
--spanish
---hola.htm
How can I make hola.htm or hello.htm link the style.css in the parent folder?
This is the file Tree:
-page folder
--main.html
--style.css
--english
---hello.htm
--spanish
---hola.htm
How can I make hola.htm or hello.htm link the style.css in the parent folder?
The replies from and are correct for the folder layout in the original post, and ’s follow-up confirms the approach works in practice. Below are practical notes and troubleshooting checks that aren’t in the thread — things that commonly cause the stylesheet to silently fail even when the link looks right. (developer.mozilla.org)
text/css, and X-Content-Type-Options: nosniff can block a stylesheet if the MIME type is wrong. If the server is misconfigured the browser may ignore the file. (developer.mozilla.org)?v=1.2) while debugging.If you want alternatives to avoid relative-path bookkeeping, you can use a site-root (leading slash) or absolute URL. Example patterns:
<link rel="stylesheet" href="/page/style.css">
<link rel="stylesheet" href="https://example.com/page/style.css"> Be cautious with a <base> element: it changes how all relative URLs are resolved, so it can break previously-working relative links unless you intend that behavior. For details on base URL rules and how relative references are resolved, see the URL/base documentation. (developer.mozilla.org)
Short checklist: open the CSS URL, check DevTools for 404/Content-Type, confirm server case/permissions, test with a root/absolute link, and clear cache. These steps find the usual causes quickly and keep the simple folder layout working reliably.
Jump to Post— jbennet 1,618If it is 1 directory above use ../(filename) (the two dots mean go 1 ditecory above)
If it is 1 directory above use ../(filename) (the two dots mean go 1 ditecory above)
<link href="../style.css" rel="stylesheet" type="text/css" /> jbennet, Thank you so much! It worked perfectly!
I'm guessing you found the thread via Google Search, Jkreifels.
From here on out, try not to "bump" topics over 3 years old.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.