|
Posted by Jonathan N. Little on 11/02/07 21:11
Tomasz Chmielewski wrote:
> I noticed that Firefox ignores img height and width.
>
> This can be demonstrated with the simple code pasted below (or, just go
> to http://wpkg.org/test.html).
>
> The code below points to a non-existing image (or an image which can't
> be fetched).
> In IE or Konqueror, we will see a 400px x 200px blank space.
>
> In Firefox and Seamonkey we just don't have any blank space (specified
> by height and width), so website look will likely break without an image.
>
> Which browser's behaviour is correct?
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html><head><meta content="text/html; charset=ISO-8859-1"
> http-equiv="content-type">
> <title>test</title>
> </head>
> <body>
> <table style="text-align: left; width: 100%;" border="1" cellpadding="2"
> cellspacing="2">
> <tbody>
> <tr>
> <td>
> <img style="width: 400px; height: 200px;" alt="Image file missing"
> src="no_such_image.jpg"><br>
> IE will show a 400px x 200px blank space. Firefox will not show any
> blank space, although we specified image width and height.
> </td>
> </tr>
> </tbody>
> </table>
> <br>
> </body>
> </html>
Since image is inline as default, if missing FF only displays the alt
text and the "height" needed got that inline text... Want constancy, then:
ADD
vvvvvvvvvvvvvvv
<img style="width: 400px; height: 200px; display: block;" alt="Image
file missing" src="no_such_image.jpg"><br>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|