我的浏览器没有加载图片 [英] my browser don't load the picture

查看:73
本文介绍了我的浏览器没有加载图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在通过asp.net设计一个网站,我使用< img>标签从我自己的计算机加载图片,但我的浏览器(Firefox或IE)没有显示它!

这是我的代码:

Hi all,I am designing a website by asp.net and I have used the <img>tag to load a picture form my own computer but my browsers(Firefox or IE) doesn''t show it !!!
that is my code:

<img  alt="picture" src="file:///C:/Users/Public/Pictures/Sample%20Pictures/Tulips.jpg" 
                
                style="margin-bottom: 0px; width: 100px; height: 100px; margin-left: 5px;"  />



当我输入这个路径到我的firefox浏览器它显示图片但在网页上它没有;显示它!!我不知道在哪里是问题!! plz帮助我....


when I type this path to my firefox browser it shows the picture but in the webpage it doesn;t show it!!I don''t know where is the problem!!plz help me....

推荐答案

只有当您使用file:/// protocol在本地查看页面时,您的代码才有效。为了能够查看图像,Web服务器应该可以访问这些图像。您可以在Web应用程序文件夹下创建名为say images的文件夹,并将HTML更改为以下所示的内容。

Your code will only work when you view page locally using file:/// protocol. To be able to view images the images should be accessible by the web server. You can create a folder named say images under your web application folder and change the HTML to something shown below.
<img alt="picture" src="images/Tulips.jpg" style="margin-bottom: 0px; width: 100px; height: 100px; margin-left: 5px;" />



问候,


Regards,


这篇关于我的浏览器没有加载图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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