Pick images of root folder from sub-folder

Moon picture Moon · Sep 7, 2010 · Viewed 251.3k times · Source

Let's say following is the directory structure of my website : DIR STRUCTURE

Now in index.html I can simply refer images like:

<img src="./images/logo.png">

But I want to refer the same image from sub.html. What should be the src?

Answer

Moses picture Moses · Sep 7, 2010

../images/logo.png will move you back one folder.

../../images/logo.png will move you back two folders.

/images/logo.png will take you back to the root folder no matter where you are/.