href的URL与src的URL的区别

  • 本文关键字:URL 区别 src href html pdf href
  • 更新时间 :
  • 英文 :


我有这两行代码,一行接一行-嵌入的pdf运行良好。当我点击pdf链接时,我得到一个404未找到。URL完全相同。问题出在哪里?

<embed src="./assets/connerschiller.pdf" type="application/pdf" width="100%" height="600px" />
<a target="_blank" href="./assets/connerschiller.pdf">View Resume</a>

我没有使用embed,但Iframe用于嵌入pdf文档。。。下面是一些例子。。。

<iframe src="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"  width="100%" height="600px" ></iframe>
<a target="_blank" href="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf">View Resume</a>

此外,您面临的404错误是因为pdf可能保存在网站文件文件夹之外的某个位置。。。如果您在localhost上遇到此问题,则可能是由于文件或驱动器权限,或者尝试检查pdf名称是否正确。。。。

href是文本将指向的链接;查看简历"转到.pdf文件。href将添加/assets/connerschiller.pdf到您的url。尝试删除""它应该能工作

最新更新