Just put the a and /a tags either side of the img tag.
You can link to any file format, not just html. If the visitor does not have software that will open that file then they will be prompted to save it on their PC.
Linking images is helpful if you have buttons or banners on your site and you want the visitor to be taken to another web page or site when they click on the image. To accomplish this, use the following code:
The first part of the code tells the browser which site to go to and the second part, of course, tells it where the image is located.