图像将在vs代码中显示在HTML扩展中的图像
我有此代码:
<!DOCTYPE html>
<html>
<head>
<h1 title="First Heading">Heading 1</h1>
<h6 title="Second Heading">Heading 2</h6>
</head>
<body>
<p title="First Paragraph">Paragraph 1</p>
<p title="Second Paragraph">Paragraph 2</p>
<a href="https://www.w3schools.com/html/html_basic.asp" >W3schools</a>
<img src="C:\Users\yorda\OneDrive\Gambar\Aseprite\.jpeg\Canyon.jpeg" alt="Pixel Art" width="320" height="180"
</body>
</html>
如果我通过File Explorer打开HTML文件(双击它并转到Chrome),它将显示图像。
,
但是如果我想通过VS代码扩展来预览我的html文件,则映像不会显示出来。
为什么会发生这种情况?有什么方法可以解决这个问题? 提前致谢。
I have this code:
<!DOCTYPE html>
<html>
<head>
<h1 title="First Heading">Heading 1</h1>
<h6 title="Second Heading">Heading 2</h6>
</head>
<body>
<p title="First Paragraph">Paragraph 1</p>
<p title="Second Paragraph">Paragraph 2</p>
<a href="https://www.w3schools.com/html/html_basic.asp" >W3schools</a>
<img src="C:\Users\yorda\OneDrive\Gambar\Aseprite\.jpeg\Canyon.jpeg" alt="Pixel Art" width="320" height="180"
</body>
</html>
If I open my html file via file explorer (double clicking it and go to chrome) it will show the image.
but if I want to preview my html file via VS Code extension the image wont show up.
why is this happen? any way to solve this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须将图像放在index.html文件的同一位置。
然后将您的IMG SRC修改为
You have to put the image in the same location of your index.html file.
then modify your img src to
我想我在其他地方读到一个扩展名不受欢迎。它称为HTML预览。找出您是否正在使用的那个。我使用它,也有同样的问题,但我还没有解决。
I think i read somewhere else that one extension is not supported well. It's called Html Preview. Find out if it is the one you're using. I use it and i have the same issue but i'm yet to solve it.