The way many ISPs work it is that to log in/upload one must use the ftg.* address but to link to it requires using the www.* address.
Ergo, you are wrong (but not really totally). The link should be to the www.* address. Note that a link within a page on your site can skip the whole site name part entirely and give a relative link. That makes your web page more “portable”.
Since the file is in the public_html folder (along with the index page) I didn’t have to put the public_html/scarf.jpg. But, if I want to put all my pictures in a folder called, say, “photos” I would, right?
This is basically due to different frames of reference to the same file system. It’s not very hard, but if you don’t understand it it’s going to make building a web page pretty difficult from the get-go.
I have a server with files on it. My home directory on it is /home/nanoda, and I have many files and sub-directories in it.
If I had ftp running, I imagine connecting to “ftp://my.ip” with username “nanoda” would put me in to “/home/nanoda”.
Most web server expect people to put their files in a special subdirectory, like “public_html”, 'cause I certainly don’t want my web server handing out any file I should happen to own. Thus, connecting to “http://my.ip/~nanoda” shows the files from /home/nanoda/public_html.
If I want an image subdirectory, it’ll be “/home/nanoda/public_html/images”, and accessable from “http://my.ip/~nanoda/images/”.
Basically, the “public_html” directory is so you can be assured that only stuff you put in there will be publicly accessible, and it’s the root, or starting place for the structure of your URL.