How To Create A Download Link - W3Schools
Có thể bạn quan tâm
Learn how to create a download link with HTML.
Download Link
You can use the HTML download attribute to specify that the target will be downloaded when a user clicks on the hyperlink.
Example
<a href="/images/myw3schoolsimage.jpg" download> <img src="/images/myw3schoolsimage.jpg" alt="W3Schools"></a> Try it Yourself »The download attribute is only used if the href attribute is set.
The value of the attribute will be the name of the downloaded file. There are no restrictions on allowed values, and the browser will automatically detect the correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).
You can also specify a value for the download attribute, which will be the new filename of the downloaded file. If the value is omitted, the original filename is used.
Example
Specify a value for the download attribute, which will be the new filename of the downloaded file ("w3logo.jpg" instead of "myw3schoolsimage.jpg"):
<a href="/images/myw3schoolsimage.jpg" download="w3logo"> <img src="/images/myw3schoolsimage.jpg" alt="W3Schools"></a> Try it Yourself »Browser Support
The numbers in the table specify the first browser version that fully supports the attribute.
| Attribute | |||||
|---|---|---|---|---|---|
| download | 14.0 | 13.0 | 20.0 | 10.1 | 15.0 |
Từ khóa » Html5 A Tag Download
-
HTML A Download Attribute - W3Schools
-
: The Anchor Element - HTML: HyperText Markup Language | MDN
-
Create A Downloadable Link Using HTML5 Download Attribute
-
How Can I Create Download Link In HTML? - Stack Overflow
-
The HTML5 Download Attribute Explained - Nathan Sebhastian
-
Quick Tip: Using The HTML5 Download Attribute - Web Design
-
HTML5 Download Attribute Guide | How It Works - WebFX
-
HTML | Download Attribute - GeeksforGeeks
-
Downloading Resources In HTML5 A[download] May Not Work As ...
-
A Look Into: HTML5 Download Attribute - Hongkiat
-
Downloading Resources In HTML5 - A[download] - v
-
HTML Download Attribute - Dofactory
-
How To Use HTML5 Download Attribute - C# Corner
-
Using The HTML5 Download Attribute | HTML Goodies