| 
	
 | 
 Posted by Ben C on 11/02/07 18:11 
On 2007-11-02, Roderik <nospam@atall.nl> wrote: 
> Tomasz Chmielewski schreef: 
>> 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? 
>>  
> 
> If the image is not available it falls back to the alternative, the alt  
> text, which is probably rendered as an inline element. 
> If it is right to fall back to an inline element, I don't know. I would  
> also prefer that it just took the dimensions as specified. 
 
I suppose the issue is whether img is display: inline or display: 
inline-block. 
 
If it's inline, then it goes from being replaced inline to just 
ordinary inline. Width and height don't apply to non-replaced inline 
elements. 
 
If it's inline-block, then it goes from being replaced inline-block 
(which is exactly the same as replaced inline) to ordinary inline-block, 
which is not the same as inline, because width and height do work for 
inline-block. That's what Opera appears to do for example. 
 
Since Firefox doesn't support inline-block, it's perhaps not surprising 
that img is replaced inline. 
 
Either is correct.
 
  
Navigation:
[Reply to this message] 
 |