html - HTML 中的本地图像
问题描述
我是一名高中生,我正在做一些有趣的事情。我已将存储在我计算机上的本地文件链接到我的网页。我该怎么做才能让其他设备访问本地 html 文件?(meme1.html)
<div id="button">
<a href="C:\Users\Desktop\MEME GENERATOR\meme1.html">
<img src="https://openclipart.org/image/2400px/svg_to_png/140365/1306313012.png" alt="Click here!" height="20%" width="20%"></a>
</div>
<div id="wrapper">
<h1><span class="tight-2">Happy Birthday!</h1>
<h2>Go ahead, press the button to generate memes!<span class="tm">™</span>.</h2>
</div>
解决方案
基本上,当您在线托管站点时,您必须将链接文件路径更改为服务器而不是本地计算机。
编辑:如果您使用纯 HTML,我的答案是,如果您使用 Django、Flask 或 dotNet Core 等后端平台,那么 URL 会在您的 webapp 中动态声明。
推荐阅读
- windows - Windows 快捷方式 (.lnk) 文件大小
- java - Gradle JavaFX - java.lang.NullPointerException:需要位置
- javascript - window.url.createobjecturl(blob) 在 Edge 中不起作用
- c# - 在 Web 应用程序中通过 Azure Active Directory 进行身份验证
- laravel-5 - Laravel 5在另一个和子句中嵌套或和子句
- amazon-s3 - AWS S3 中数据的增量更新
- django - Django inline_formset - 确保至少选择一项
- javascript - forEach 中的 Http 请求 - NodeJS
- vb.net - 使用 Linq 对数据表进行分组会产生错误:“方法定义
在这种情况下无法访问” - mysql - 远程服务器中的Mysql错误。但在我的本地机器上工作正常