Page 1 of 1

img width/height necessary ?

Posted: Wed Apr 09, 2008 6:30 am
by yurik
I'm programming CSS and xhtml 1.0.

I'm wondering if the width/height are necessary for img or can I safely erase them. Will Internet Explorer and Firefox interpret it correctly ?

<img src="pic.jpg" alt="text" width="138" height="200" />

Re: img width/height necessary ?

Posted: Wed Apr 09, 2008 6:37 am
by onion2k
It'll work, but they really should be there. It'll make the page render faster, and they're a factor in accessibility ratings.

EDIT: Actually.. aren't they required by the XHMTL spec? I use HTML so I'm not sure...

Re: img width/height necessary ?

Posted: Wed Apr 09, 2008 10:46 am
by matthijs
It's better to have them. Can't remember exactly why, but something with IE and not rendering well or something (what's new)