2013-04-06 90 views
0

所以我用下面的代码来显示图像:为什么我的图片没有出现在Firefox中?

<img id='fb' 
src="D:/Users/sel0010/Documents/Cadets/Webmaster/Photos/Icons/fblogo.png" 
width="25" 
height="25" 
alt=" Facebook | " /> 
</a> 

当我测试谷歌浏览器的网站,我可以看到它一样在Internet Explorer但是当我尝试在Firefox没有出现,除了什么写在alt=""。我正在测试Google Chrome Version 26.0.1410.43米,IE 9.0.8.8112.16421Firefox version 7.0.1

我真的很迷茫,特别是与IE浏览器工作,所以任何帮助将是惊人的,

感谢。

+0

您是否尝试过使用相对路径?例如:'src =“fblogo.png”' – 2013-04-06 12:25:09

+0

我没有,它的工作,谢谢! – Jacob 2013-04-06 12:30:24

回答

2

两个解决方案

  1. 使用相对路径:

    <img id='fb' src="Icons/fblogo.png" width="25" height="25" alt=" Facebook | " /> 
    
  2. 前缀file:///为本地图片:

    <img id='fb' src="file:///D:/Users/sel0010/Documents/Cadets/Webmaster/Photos/Icons/fblogo.png" width="25" height="25" alt=" Facebook | " /> 
    
1

你应该使用file://也SRC前添加一个空格

变化:

<img id='fb'src="D:/Users/sel0010/Documents/Cadets/Webmaster/Photos/Icons/fblogo.png" width="25" height="25" alt=" Facebook | " /></a> 

要:

<img id='fb' src="file://D:/Users/sel0010/Documents/Cadets/Webmaster/Photos/Icons/fblogo.png" width="25" height="25" alt=" Facebook | " /></a> 
+0

谢谢李,我在这里12小时轮班结束......一个小脑袋死了。 – 2013-04-06 12:31:13

相关问题