简体   繁体   中英

Adding an image from a url - html

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

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

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.

For instance, the url you provided:

http://www.google.co.il/imgres?q=picture&hl=iw&sa=X&rlz=1C1SKPL_enIL452IL452&tbm=isch&prmd=imvnsl&tbnid=BAlLxbccyZkwSM:&imgrefurl=http://animal.discovery.com/mammals/cheetah/&docid=qDOKJbIkYvvzyM&imgurl=http://animal.discovery.com/mammals/cheetah/pictures/cheetah-picture.jpg&w=625&h=450&ei=Y-grT8_ZNYnntQb4kID0DA&zoom=1&iact=hc&vpx=693&vpy=191&dur=850&hovh=190&hovw=265&tx=155&ty=84&sig=110318714666115395229&page=1&tbnh=141&tbnw=183&start=0&ndsp=19&ved=1t:429,r:1,s:0&biw=1280&bih=656

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!" />

if you want to add any url for image you will need to right click on that image and click on copy image address. and paste that address as url to get image on your webpage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM