Jump to content
Sign in to follow this  
AndrewAK

What is the proper path to sub-folders?

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?

Share this post


Link to post
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".

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...