从网址添加图片-html [英] Adding an image from a url - html

查看:62
本文介绍了从网址添加图片-html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在html页面上显示来自互联网的图像.

I am having trouble displaying an image from the internet on my html page.

该行是:

<img src="http://www.somepic..." alt="pic" />

这有什么问题?那仅适用于我磁盘上的图像吗?

What is wrong with it? Does that only work with images that are on my disk?

谢谢

推荐答案

根据您在上面的注释中提供的URL,我猜您实际上并没有链接到图像,而是喜欢网页,但误以为是图片.

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,而不是图片本身.

Is the URL of a webpage showing the image, not the image itself.

确保您要链接到实际的图像本身:

Make sure you're linking to the actual image itself:

<img src="http://animal.discovery.com/mammals/cheetah/pictures/cheetah-picture.jpg" 
alt="Cheetah!" />

这篇关于从网址添加图片-html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆