Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > HTML / XHTML
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 08-12-2011, 06:58 PM
  #1
SBS
Novice (Level 1)
 
Join Date: Mar 2011
Posts: 7
iTrader: (0)
SBS is an unknown quantity at this point
<img> using PNG doesn't display

I am using IE and for some reason PNG images specified using an <img> tag display blank. I know the files exist as there is no 'X' where the image is supposed to be but I can't see them. If I change to using a JPG then the images appear.

My code is extremely simple and looks like:

Code:
<html><body><img src="images/test.png"></body></html>
I have tried using width and height parameters but it only changes the size of the blank area.

Does the <img> tag support PNG images? Is there some other reason why the images display blank?
SBS is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-12-2011, 11:43 PM
  #2
Mandarin
Still retired
 
Mandarin's Avatar
 
Join Date: Jul 2009
Location: Michigan
Posts: 1,748
iTrader: (0)
Mandarin has a spectacular aura aboutMandarin has a spectacular aura aboutMandarin has a spectacular aura about
Yes, .png images are supported by every browser you'd encounter anymore. I bet that the files on your server have some capitalization in them but your URIs don't, or vice versa. On most servers, capitalization matters. It's easiest just to stick with all-lowercase, all the time.
Mandarin is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-13-2011, 12:00 AM
  #3
SBS
Novice (Level 1)
 
Join Date: Mar 2011
Posts: 7
iTrader: (0)
SBS is an unknown quantity at this point
Hmm, I don't think it has anything to do with capitalisation and I am not actually using a server. I just have a file test.html file sitting on my hard drive which has the content I posted and the PNG file in an images sub-folder beneath it. I simply open the HTML file in a web browser (IE 7).

I know it finds the file because if I change the src reference to something invalid (i.e. file doesn not exist) then I get a red X where the image should be. Now I just get a blank area where the image should be.

I have tried other PNGs and they all do the same but using a GIF or JPG works.

Could it have something to do with transparency? The PNG displays fine in an image editor.
SBS is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-13-2011, 12:32 AM
  #4
Mandarin
Still retired
 
Mandarin's Avatar
 
Join Date: Jul 2009
Location: Michigan
Posts: 1,748
iTrader: (0)
Mandarin has a spectacular aura aboutMandarin has a spectacular aura aboutMandarin has a spectacular aura about
Internet Explorer 7 is two versions and nearly five years old. Upgrade already.

That being said, IE7 supported .png images with alpha transparency, so that shouldn't be the problem. You might have a corrupt image. Well, maybe not corrupt, but it's possible that your image-editing program interprets the PNG specification differently than IE does. Try opening the page in a real browser like Firefox. Then try re-saving the image and reloading the test page. Then try creating a basic page with no styles and no elements but an img. Then try moving the image into the same directory as the test page. Then upload the page and image and test everything from a public web host.

If none of those things leads to a solution, post a link to your test page or only as a last resort include the HTML from your test page and attach the test image to your followup post.
Mandarin is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-14-2011, 05:16 AM
  #5
horndog69
Aspirant (Level 2)
 
Join Date: Aug 2011
Posts: 15
iTrader: (0)
horndog69 is an unknown quantity at this point
First find out if the copy of the png file works. Right click on image (blank spot) copy image url and then past url into address bar of another tab and see if it shows up. If it doesn't then the file is likely bad then you might need to delete the file from your site and reupload it. I agree with the other guy, use Fire Fox or Chrome. I use Chrome and love it, but I don't see how the browser could have anything to do with it.
horndog69 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 01:46 PM.

   

Mascot team created by Drawshop.com | Web Hosting

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.