简体   繁体   English

在 VS Code 中使用 Live Server 扩展时,图像未加载到我的 html 页面中

[英]Image not loading in my html page when using Live Server extension in VS Code

I have started studying web development and decided to use VS Code.我已经开始研究 web 开发并决定使用 VS Code。 It is currently running on a Linux Mint dist (19.03).它目前在 Linux Mint dist (19.03) 上运行。 Decided to add some extensions, including Live Server so I don't need to constantly hit F5 to see the changes.决定添加一些扩展,包括 Live Server,这样我就不需要经常按 F5 来查看更改。 Problem is: I inserted an image on my html page and if I open the page through Live Server, the picture just doesn't show up, but if I go to the HTML file and open it, it shows perfectly.问题是:我在我的 html 页面上插入了一张图片,如果我通过 Live Server 打开页面,图片就不会显示,但如果我将 go 插入 HTML 文件并完美显示它。 Could someone help me with this issue?有人可以帮我解决这个问题吗? Thank you: I am leaving the code here so you can have a look:谢谢:我将代码留在这里,以便您查看:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>DOM</title>
  </head>
  <script src="dom.js"></script>
  <body>
    <img src="/../HTML/me.jpg" />
  </body>
</html>

/../ in the img src tag does not look correct. /../ 在 img src 标签中看起来不正确。

暂无
暂无

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

相关问题 VS Code Live Server Extension 在使用 CSS 网格布局时不显示背景 colors - VS Code Live Server Extension not displaying background colors when using CSS Grid layout 为什么 Live Server 只加载一半的 HTML 代码? - Why is Live Server only loading half my HTML code? vs 代码实时服务器扩展不工作 - vs code live server extension not working html 文件中的 javascript 在我使用 VS Code 的实时服务器中工作正常,但如果我在本地打开 .html 文件,它就不起作用 - javascript in a html file works fine in my live server using VS Code but if i open the .html file locally it doesn't work 我在 vscode 的 html 代码中使用了一个透明图像,但是当我使用实时服务器打开它时,图像不会变得透明 - I have a transparent image to use in my html code in vscode but when I open it with live server the image doesn't get transparent 音频文件 (.mp3) 不会在页面重新加载时播放,仅在 VS 代码/Live Server 扩展在保存时自动重新加载时播放一次 - Audio files (.mp3) don't play on page reload, only once when VS code/Live Server extension auto-reloads on save VS Code 的实时服务器扩展不自动重新加载 - Live Server Extension for VS Code not Auto-Reloading VS Code Live Server 扩展无法使用端口 6566 - VS Code Live Server extension not working port 6566 实时服务器(与代码)扩展扩展了整个网页 - Live server (vs code) extension scales up the whole webpage VS 代码实时服务器扩展不起作用 - VS code live server extension doesn't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM