logoGarden Of Blog


Rollover Image Bug in IE 6

Posted in geek out by Marcus Del Greco on August 10th, 2006

Let’s say you create a rollover image using Dreamweaver, which is a great way to do it because Dreamweaver gives you the backward-compatible Javascript to degrade nicely with older browsers.  Everything works fine.

Then you decide to change the image(s) (but not the filenames), and you change the size of them.  Oops!  Dreamweaver had explicitly declared image height and width in the <img> tag, so the new images are distorted.

Not a problem… just adjust the height and width attributes in the HTML to match the new images.  Or if you’re lazy like me, and don’t want to look up the new image size, just clear out the height and width attributes, right?  Height and width are optional attributes that only aid in the pre-rendering of the HTML layout before all the images download, right?

Not if you want it to work in Internet Explorer 6.  The rollover disappeared entirely in IE, though it looked perfect in Safari, Firefox and so on.

The moral is: declare height and width for rollover images if you want to see them in IE 6.  Microsoft sucks it again.

Leave a Reply