How to create a download link with HTML?


To create a download link with HTML, the code is as follows −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h1>Download Link example</h1>
<a href="https://i.picsum.photos/id/225/800/800.jpg" download>
<img src="https://i.picsum.photos/id/225/800/800.jpg" style="width: 300px;height: 300px;" >
</a>
<h2>Click on the image above to download it</h2>
</head>
<body>

Output

The above code will produce the following output −

Updated on: 08-May-2020

590 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements