I have the directory structure that is shown in the image.
If i have this code in HomePage.ss
<img src="../../images/sprites.jpg" />
Why this relative path is incorrect? Failed to load the given url.

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
what you need to know about SilverStripe is that it reads your templates, and outputs them.
So if you have the url
mysite.com/homethen it will look like the file is located inside the folder/home, if your url ismysite.com/page/subpageit will appear as if the folder was/page/subpagethis means you can NOT use relative paths like “../images/sprites.jpg” in templates (you can use those in css though).
as @Mark has already mentioned in a comment, the way to go is using
$ThemeDirm which will output the path to the theme folder, so your image should look like this:<img src="$ThemeDir/images/sprites.jpg" />