HTML anchor tag – linking files with the <a> tag

HTML anchor tag – linking files with the <a> tag cover image
  1. Home
  2. HTML
  3. HTML anchor tag – linking files with the <a> tag

Links on web pages are created using the anchor <a> tags. These links can point to a different document on the Internet or to some anchor on the same page. Documents linked in this manner need not be HTML (or PHP/ASP) files. You can place a link to any kind of file.

So if you have a program in .exe format or a .zip file you can attach it to a link like:

<a href="brahms.zip">Download Brahms Waltz #3 (zip file)</a>

Download Brahms Waltz #3 (zip file)

When you click on such links, and your browser is not able to display the file on its own, it pops up a window asking you to “open” or “save” the file. If you choose to open the file, the browser will launch the application to which such files are attached or else display a window asking you to pick the software, if it cannot open the software that uses such file formats. You can also specify a target location on your systems’ hard drive to save the file to a desired location.

HTML