下载链接将打开该链接,而不是下载它

时间:2019-02-20 19:09:36

标签: html5

我使用了代码:

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

但是我无法使链接下载PDF。而是打开PDF。

该属性为“下载”,但不起作用

1 个答案:

答案 0 :(得分:0)

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

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