简体   繁体   English

链接到pdf在移动浏览器上不起作用

[英]link to pdf not working on mobile browser

I have a basic html link to a pdf file on a page, when clicked is opens the pdf on PC but on mobile nothing happens when the link is clicked. 我在页面上有一个指向pdf文件的基本html链接,当单击时,会在PC上打开pdf,但在移动设备上,单击链接时不会发生任何反应。 I have 我有

<a href="linktofile.pdf" target="_blank">Click to pdf</a>

Can someone help advise how do I make it work on mobile (andorid & ios) so that users can just click to download the pdf? 有人可以帮助建议我如何使其在移动设备(andorid和ios)上运行,以便用户只需单击即可下载pdf吗?

Thanks! 谢谢!

try using the full link like http://example.com/linktofile.pdf . 尝试使用完整链接,例如http://example.com/linktofile.pdf If still you get a problem, then try checking with your friends phone. 如果仍然遇到问题,请尝试与您的朋友电话联系。 I've just now checked with my website, it's working with Chrome built-in browser. 我刚刚检查了我的网站,它可以与Chrome内置浏览器一起使用。 Also check for default PDF Viewer. 还要检查默认的PDF Viewer。

Try without target. 尝试无目标。 I would use modal to view external files such as PDF, images, etc.. 我将使用模式来查看外部文件,例如PDF,图像等。

thanks for all the response. 感谢所有的答复。

I found the problem was not on the a href but rather on the css class. 我发现问题不在a href上,而在css类上。 there was a class used causing the link un-clickable on mobile which made it not responding to any tap. 曾经使用过一个类,导致该链接在移动设备上无法点击,从而使其无法响应任何点击。 once the class is removed everything worked fine. 删除课程后,一切正常。

sorry for my careless mistake. 对不起,我的粗心大意。

Thank for all you time guys. 谢谢你们所有的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM