Leshy
Leshy

Reputation: 97

How to Link to a Stylesheet in a subfolder

I have an HTML file, index.html, for my website, in a folder. This folder contains the index.html file, and another folder called "Stylesheets", with the stylesheet.css file inside. How do I link to it? I know how to do a link tag, but the href bit is giving me a bit of trouble. I've tried

href="../stylesheets/stylesheet.css"

and a few variants of it with the dots. Any ideas? I've tried a couple google searches but the question is a bit too complex to describe in a simple google query. Please Help!

Upvotes: 2

Views: 10263

Answers (2)

Zivanovic
Zivanovic

Reputation: 134

Your path - href="../stylesheets/stylesheet.css" is basically doing the opposite of what you want.It's not going one folder further as you wish.

To accomplish what you want, you are going to have this path:

href="stylesheets/stylesheet.css"

Here you can read more about File Paths.

Upvotes: 3

pritesh
pritesh

Reputation: 543

Use href="stylesheets/stylesheet.css" or href="./stylesheets/stylesheet.css" Both mean the look for stylesheet.css file inside the stylesheet folder inside the current folder.

Upvotes: 3

Related Questions