首页 > 解决方案 > 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">™&lt;/span>.</h2>
</div>

标签: htmlimage

解决方案


基本上,当您在线托管站点时,您必须将链接文件路径更改为服务器而不是本地计算机。

编辑:如果您使用纯 HTML,我的答案是,如果您使用 Django、Flask 或 dotNet Core 等后端平台,那么 URL 会在您的 webapp 中动态声明。


推荐阅读