
How to Make a Download Button in HTML
A rather simple but often overlooked attribute in HTML is the download
attribute. Simply add it to an anchor if you want to download the resource instead of opening it in a new tab. No special script or anything else needed.
<!--
Use the download attribute to signal that the resource
should be downloaded rather than opened in the browser
-->
<a href="/cv.pdf" download>π₯ Download my CV</a>
Copied to clipboard!
If you omit the value, the original filename will be used with its correct extension, but you can specify an alternative filename as well.


Looking to improve your skills? Check out our interactive course to master HTML from start to finish.

Resources:
π More Webtips
Master the Art of Frontend
Access exclusive interactive lessons
Unlimited access to hundreds of tutorials
Remove ads to learn without distractions