Jump to content

What is the proper path to sub-folders?


AndrewAK

Recommended Posts

This Link refers to a file that is in the main folder 

<link rel="stylesheet" type="text/css" href="mystyle.css">

What is the proper path used when referencing a file located in a sub-folder?

Link to comment
Share on other sites



You can use a relative link: 

Index
CSS (folder)
    mystyle.css
images (folder)
    img1.jpg
   background.jpg

The CSS fille is inside the CSS folder. So link from index to the css file you use: "css/mystyle.css".
To link from the CSS to the images (for say, a background-image, you can do this: "../images/background.jpg".

 

 

 

If instead you use an absolute link you can use: "http://www.mysite.com/css/mystyle.css".

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...