图片在HTML上没有显示出来。

huangapple go评论55阅读模式
英文:

Image not showing up on Html

问题

我完全不懂HTML,正在尝试使用记事本编写我的第一个东西。我已经添加了一个图片显示的部分,但它不起作用。我做错了什么?我已经编写了下面的代码,并将我遇到问题的部分用粗体标记出来。

我尝试让图片显示出来,但没有成功。

<body>
  <h1>My First Heading</h1>

  <p>My first paragraph.</p>
  <a href="https://www.youtube.com/watch?v=Vk4KK-gh0FM&amp;pp=ygUObm9raWEgcmluZ3RvbmU%3D"> Iphone </a> 
  <img src="https://en.wikipedia.org/wiki/File:IPhone_14_Pro_vector_(blue).svg" width="500" height="600">
</body>

你可能需要检查图片链接是否正确。

英文:

I'm completely new to HTML and am trying to code my first thing using Notepad. I put the thing for an image to show up but it won't. what am I doing wrong? I've written the code below and I put the part I'm having trouble with in bold.

I tried to make the image show up but it didn't work.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

&lt;body&gt;
  &lt;h1&gt;My First Heading&lt;/h1&gt;

  &lt;p&gt;My first paragraph.&lt;/p&gt;
  &lt;a href=&quot;https://www.youtube.com/watch?v=Vk4KK-gh0FM&amp;pp=ygUObm9raWEgcmluZ3RvbmU%3D&quot;&gt; Iphone &lt;/a&gt; **
  &lt;img src=&quot;https://en.wikipedia.org/wiki/File:IPhone_14_Pro_vector_(blue).svg&quot; width=&quot;500&quot; height=&quot;600&quot;&gt;**
&lt;/body&gt;

<!-- end snippet -->

答案1

得分: 2

这是实际的图像网址:https://upload.wikimedia.org/wikipedia/commons/3/36/IPhone_14_Pro_vector_%28blue%29.svg

英文:

The URL you're using is for a web page, not an image.

This is the actual image URL: https://upload.wikimedia.org/wikipedia/commons/3/36/IPhone_14_Pro_vector_%28blue%29.svg

答案2

得分: 0

你的URL正在将其定向到网页本身,而不是图像。

我认为应该将此URL放在src上:
https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/IPhone_14_Pro_vector_%28blue%29.svg/295px-IPhone_14_Pro_vector_%28blue%29.svg.png

英文:

your URL is directing to the webpage itself, not the image.

I believe this should be the URL placed on the src:
https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/IPhone_14_Pro_vector_%28blue%29.svg/295px-IPhone_14_Pro_vector_%28blue%29.svg.png

huangapple
  • 本文由 发表于 2023年7月14日 04:35:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76683069.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定