【问题标题】:The download link opens the link instead of downloading it下载链接打开链接而不是下载它
【发布时间】:2019-02-21 13:28:17
【问题描述】:

我使用了代码:

<a download href="https://web.stanford.edu/group/csp/cs21/htmlcheatsheet.pdf"> Download cheetsheat</a>

但我无法通过链接下载 PDF。它会打开 PDF。

属性是“下载”但它不起作用

【问题讨论】:

标签: html


【解决方案1】:

将下载属性设置为文件名:

<a download="htmlcheatsheet.pdf" href="https://web.stanford.edu/group/csp/cs21/htmlcheatsheet.pdf"> Download cheetsheat</a>

【讨论】:

    猜你喜欢
    • 2022-11-10
    • 2023-04-04
    • 1970-01-01
    • 2011-01-03
    • 1970-01-01
    • 1970-01-01
    • 2011-08-27
    • 2013-07-31
    • 2018-12-06
    相关资源
    最近更新 更多