Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:05:44+00:00 2026-06-17T16:05:44+00:00

As it turns out, referencing local resources can be a rub point for some.

  • 0

As it turns out, referencing local resources can be a rub point for some. I’m looking for a canonical answer to local resource referencing, and what they mean.

Take these examples, what is the difference between these reference paths?

  • <img src="myfile.png" /> (no leading slash)
  • <img src="/myfile.png" /> (with leading slash)
  • <img src="folder/myfile.png" /> (no leading slash / in subfolder)
  • <img src="/folder/myfile.png" /> (with leading slash / in sub folder)
  • <img src="../folder/myfile.png" /> (with dots and a leading slash / in sub folder)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:05:45+00:00Added an answer on June 17, 2026 at 4:05 pm
    • A leading slash tells the browser to start at the root directory.
    • If you don’t have the leading slash, you’re referencing from the current directory.
    • If you add two dots before the leading slash, it means you’re referencing the parent of the current directory.

    Take the following folder structure

    demo folder structure

    notice:

    • the ROOT checkmark is green,
    • the second checkmark is orange,
    • the third checkmark is purple,
    • the fourth checkmark is yellow

    Now in the index.html.en file you’ll want to put the following markup

    <p>
        <span>src="check_mark.png"</span>
        <img src="check_mark.png" />
        <span>I'm purple because I'm referenced from this current directory</span>
    </p>
    
    <p>
        <span>src="/check_mark.png"</span>
        <img src="/check_mark.png" />
        <span>I'm green because I'm referenced from the ROOT directory</span>
    </p>
    
    <p>
        <span>src="subfolder/check_mark.png"</span>
        <img src="subfolder/check_mark.png" />
        <span>I'm yellow because I'm referenced from the child of this current directory</span>
    </p>
    
    <p>
        <span>src="/subfolder/check_mark.png"</span>
        <img src="/subfolder/check_mark.png" />
        <span>I'm orange because I'm referenced from the child of the ROOT directory</span>
    </p>
    
    <p>
        <span>src="../subfolder/check_mark.png"</span>
        <img src="../subfolder/check_mark.png" />
        <span>I'm purple because I'm referenced from the parent of this current directory</span>
    </p>
    
    <p>
        <span>src="subfolder/subfolder/check_mark.png"</span>
        <img src="subfolder/subfolder/check_mark.png" />
        <span>I'm [broken] because there is no subfolder two children down from this current directory</span>
    </p>
    
    <p>
        <span>src="/subfolder/subfolder/check_mark.png"</span>
        <img src="/subfolder/subfolder/check_mark.png" />
        <span>I'm purple because I'm referenced two children down from the ROOT directory</span>
    </p>
    

    Now if you load up the index.html.en file located in the second subfolder
    http://example.com/subfolder/subfolder/

    This will be your output

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: Turns out I just had some values -switched-. I'm working with OpenGL and
Solution Edit: Turns out you can't use the PHP SDK to return the correct
Turns out jQuery's implicit looping goes both way: <div class=classOne> some content </div> <div
Turns out many innocently looking things are undefined behavior in C++. For example, once
After doing some research into Dateperiod, it turns out it by default excludes the
Answer: It turns out I had neglected to use the new keyword when creating
UPDATE: Turns out I had skipped one checkbox (4) as can be seen from
It turns out that iptables doesn't handle leading zeros too well. As $machinenumber that
UPDATE Turns out I'm just tired. There isn't any problem here sorry for wasting
It turns out that in order to do this one has to bind the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.