Forum Moderators: open

Message Too Old, No Replies

Gecko, CSS1Compat mode, and image placeholder

         

Achernar

11:45 pm on Jul 25, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



Is there a way to force gecko to display placeholders when images have failed to load in a document with a valid html4 doctype (when gecko is in CSS1Compat mode)?
IE and Opera do, (with or without alt attributes). I don't want to use "img {display: block;}" since it breaks other things in the layout, and since when alt="" there is no indication that there is an image (except by the space used).
Test images have height, width and alt (empty or not) attributes, but gecko always ignores the dimension.

I know a way to get the page rendered in backCompat in gecko and Opera while being rendered as CSS1Compat in IE, but I would prefer if all browsers were in CSS1.

lavazza

10:17 am on Jul 28, 2007 (gmt 0)

10+ Year Member



Mozilla say they are complying with the w3C standards:
[developer.mozilla.org...]

The w3C say Use the alt attribute to describe the function of each visual [w3.org]

Also from the w3C: [w3.org...]

4.1.4 Floating elements

Using the 'float' property, an element can be declared to be outside the normal flow of elements and is then formatted as a block-level element

img {
background:#f00;
float:left;
}

in the CSS will create (for a 'missing' image) a red 'placeholder' the width and height specified in the HTML - regardless of the length of your alt attribute (although... if your alt text is quite long, it WON'T wrap in IE7 or Opera9, but it will in FF2)