On Mon, 30 Apr 2007, Skip Knox wrote:

>> <img src="innocents.jpg" alt="Innocents Abroad book cover"
> width="200px"
>> height="295px" />
> I didn't realize I had to specify a width and height. Seems to work
> with or without the same way.

If the dimensions set are the same as the dimensions of the image itself, 
it makes no difference in rendering result whether you specify the width 
and height in HTML or in CSS. However, setting the dimensions may speed up 
rendering of the page, since the browser can reserve space for the image 
before having got the image data, so it continue formatting the page with 
no need for reformatting later.

If you set the dimensions in HTML, they should be pure numbers, e.g. 
width="200" height="295" (though browsers generally accept the 
syntactically incorrect form as well, ignoring everything after the 
numbers). On the other hand, if you set them in CSS, the unit (px) is 
required, e.g. style="width: 200px; height: 295px".

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to