从 url 添加图像 - html
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9129635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding an image from a url - html
提问by user690936
I am having trouble displaying an image from the internet on my html page.
我无法在我的 html 页面上显示来自互联网的图像。
The line is:
该行是:
<img src="http://www.somepic..." alt="pic" />
What is wrong with it? Does that only work with images that are on my disk?
它有什么问题?这只适用于我磁盘上的图像吗?
Thank you
谢谢
回答by Jamie Dixon
Based on the URL you've presented in the comments above, my guess is that you're not actually linking to an image, you're liking to a web page but mistaking it for an image.
根据您在上述评论中提供的 URL,我的猜测是您实际上并没有链接到图像,您喜欢的是网页,但将其误认为是图像。
For instance, the url you provided:
例如,您提供的网址:
Is the URL of a webpage showing the image, not the image itself.
是显示图像的网页的 URL,而不是图像本身。
Make sure you're linking to the actual image itself:
确保您链接到实际图像本身:
<img src="http://animal.discovery.com/mammals/cheetah/pictures/cheetah-picture.jpg"
alt="Cheetah!" />