Open In App
Related Articles

How to create a download link with HTML ?

Like Article
Save Article
Report issue

There are so many downloads from the websites daily, we can’t even count it’s beyond imagination. But as a programmer, you should know about creating a download link for yourself too so that when you need to add it to your website, it will be easy for you to add this feature. In this article, we will learn how to create a download link with html.

Download Link is a link that will download the specific file when the user clicks on it. Now, let’s talk about the attribute which will be used in the code while writing it. The “download” attribute is used to make the link downloadable. It will specify the target (pdf, zip, jpg, doc, etc) that will be downloaded only when the user clicks on the link. 

Note: The download attribute can be only used when the href attribute is set before.


<a href="NameOfFile.extension" download></a>

Example: This example describes how to create a downloadable link.


<!DOCTYPE html>
    <title>Download Link</title>
        Demonstration for creating 
        a Download Link in HTML
    <!-- Using the <a> tag with href 
        and download attributes -->
    <a href="gfglogo.png" download>
        Click Here to download the image



Supported Browsers:

  • Google Chrome
  • Firefox
  • Microsoft Edge
  • Safari
  • Opera

Last Updated : 20 Sep, 2021
Like Article
Save Article
Share your thoughts in the comments
Similar Reads