Computer >> Computer tutorials >  >> Programming >> HTML

How to create a download link with HTML?


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

Example

<!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 −

How to create a download link with HTML?