0

I have a few folders like Pages(html files go here), Javascript(script files), CSS(css files), images.

In my html file I wanna give path and I am not sure how I am supposed to give it. If the file is going to be in the same folder the following will work

<img src="a_logo.gif" alt=""/> 

But in my case I tried

<img src="../images/a_logo.gif" alt=""/>

which didn't work. Any leads?

Thanks

Folder Structure

Folder A
|
|-----Folder VT
      |
      |-----HTML(a.html)
      |-----JS
      |-----CSS
      |-----images

Inside a.html I wanna add js,css,images.

6
  • I suspect a typo error may be the issue or may be the incorrect folder structure Commented Dec 24, 2015 at 9:32
  • Possible duplicate of Basic HTML - how to set relative path to current folder? Commented Dec 24, 2015 at 9:33
  • ../ is up one folder level from where the html file is, then it looks for the images folder Commented Dec 24, 2015 at 9:33
  • you haven't said where the images go or how your pages are served - ie do you have url rewriting? basically, if you are using relative paths, it will be from the url the page is served to the url where the image is served Commented Dec 24, 2015 at 9:35
  • a.html inside HTML folder? Commented Dec 24, 2015 at 9:36

1 Answer 1

1

Only use of images/a_logo.gif will help to run code properly,You dont need to write ../images/
so here is a code: <img src="images/a.gif" alt=""/>

Also, check if given images are present image folder and naming convention provided are right.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you. img src="..\images\a.gif" worked to me finally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.