img width/height necessary ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
yurik
Forum Newbie
Posts: 7
Joined: Tue Feb 12, 2008 3:52 pm
Location: Oushuu, Japan

img width/height necessary ?

Post 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" />
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: img width/height necessary ?

Post 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...
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: img width/height necessary ?

Post 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)
Post Reply