Jacob
Jacob

Reputation: 25

Why are my images not appearing in firefox?

So I'm using the following code to display an image:

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

When I test my site on Google Chrome I can see it same as on Internet Explorer however when I try on Firefox nothing appears except for what is written under alt="". I'm testing on Google Chrome Version 26.0.1410.43 m, IE 9.0.8.8112.16421 and Firefox version 7.0.1.

I am really confused, especially with IE working so any help would be amazing,

Thanks.

Upvotes: 0

Views: 126

Answers (2)

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167250

Two Solutions

  1. Use a relative path:

    <img id='fb' src="Icons/fblogo.png" width="25" height="25" alt=" Facebook  | " />
    
  2. Prefix file:/// for local images:

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

Upvotes: 2

David Houde
David Houde

Reputation: 4778

You should use file:// and also add a space before src

Change:

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

To:

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

Upvotes: 1

Related Questions