The relative reference would be
<img src="../images/logo.png">
If you know the location relative to the root of the server, that may be simplest approach for an app with a complex nested directory hierarchy - it would be the same from all folders.
For example, if your directory tree depicted in your question is relative to the root of the server, then index.html and sub_folder/sub.html would both use:
<img src="/images/logo.png">
If the images folder is instead in the root of an application like foo
below the server root (e.g. http://www.example.com/foo
), then index.html (http://www.example.com/foo/index.html
) e.g and sub_folder/sub.html (http://www.example.com/foo/sub_folder/sub.html
) both use:
<img src="/foo/images/logo.png">