Practical Exercise 15: Download Links
Discover how to create HTML download links to offer files directly from your website. Learn with a simple and useful practical exercise for real-world projects.
Activity
Create a link that allows a file to be downloaded. In the same folder, you must have your HTML document and a file to download. The download file can be in a subfolder, for example, called "file". Try it with a file in PDF format.
Interactive Solution
Solution with complete HTML code
HTML
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<title>Enlace de Descarga</title>
</head>
<body>
<h1>Descargar Archivo</h1>
<a href="archivo/mi_documento.pdf" download>Descargar ⬇</a>
</body>
</html>