Ajax Delay and Flicker

T

Thomas Allen

The value of the width and height attributes of img elements are either a
percentage (like "50%") or they are an integer representing the number of
pixels (like "250").

So this should be an image with a width of 250 pixels and a height of 100
pixels:

<img src="nothing.gif" alt="" width="250" height="100">

In this example, width and height should just be ignored:

<img src="nothing.gif" alt="" width="250px" height="100px">

Based on a little testing, no major browser ignores those values, and
the W3C validator doesn't catch this. I thought that perhaps all non-
digit, non-% chars are stripped when interpreting the attribute.
However when testing CSS1 units in Firefox,

* The units px, pt, pc, in, and mm are interpreted as a unitless value
(interpreted as px)
* em, ex, and cm are completely ignored

Interesting. Looks like I have an excuse to check out the Firefox
source and see how this reflects in the code :^)

Anyway, do you know of any browsers that ignore 'px' for the width
attribute, or of a validator that would note this?

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,646
Members
47,253
Latest member
AntwanNews

Latest Threads

Top