George Shearer

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromGeorge Shearer
ToMe
SubjectPNG file will not display in Firefox
Date16 March 2006 10:12
HI Mark
A friend's site (honestly!) at [URL] has a png
banner image that will not display in Firefox.  Sadly the site was designed
for IE only and looks a mess in Firefox generally but I'd like to help him
get the banner sorted.

In Firefox when you right click the place holder and choose View Image it
says:

"The image [URL] cannot be
displayed, because it contains errors."

However it works fine in IE and Opera.

Is there anything obvious in the coding that would cause this?

Kind regards

George
FromMe
ToGeorge Shearer
SubjectRe: PNG file will not display in Firefox
Date16 March 2006 10:47
AttachmentFixed image
George,

> A friend's site has a png banner image that will not display in Firefox.
> However it works fine in IE and Opera.

In Opera 8 yes. It fails completely in Opera 9, as well as any number of 
image editors. The image file is corrupted. It looks like IE and Opera 8
deal with that, but very little else. I have attached a fixed image.

> Sadly the site was designed
> for IE only and looks a mess in Firefox generally but I'd like to help him
> get the banner sorted.

The layout also fails in Opera 9. The reason it fails appears to be the box
model;

Standards:
width = width of content.

IE 5:
width = width of content + left/right padding + left/right border.

The width of the left panel is set assuming a IE 5 box model. The doctype of
the page triggers quirks mode rendering in most browsers. If you use a
doctype that triggers strict mode in IE, it will fail in IE as well:
http://www.hut.fi/u/hsivonen/doctype.html

The reason this fails in Opera 9 and Firefox is because they do not use the
IE 5 box model in either strict or quirks mode. IE 6 and Opera 8 use it in
quirks mode only.

I recommend using strict mode rendering, so all current browsers give the
standards response, then adjust the width until it works:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Older IE versions will use the IE 5 box model, but that will not destroy the
layout, it will just make the left panel a little narrower.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromGeorge Shearer
ToMe
SubjectRe: PNG file will not display in Firefox
Date17 March 2006 15:21
Hi Mark
Just wanted to say thanks for helping with the png file problem and other
issues with the site.  I have forwarded your email to my friend so hopefully
he can get it fixed.

Regards

George
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.