PDA

View Full Version : Problems with image height in IE



bkirish
30 Apr 2010, 04:35 PM
I am putting together a portfolio site. It can be viewed at www.brookeirishdesign.com. The problem is that I am using image swaps on my page. All of the images are the same width, but varying height. Thus, I used the tag "height="relative" for my images so that it does not warp from image to image. This works beautifully in Firefox, Safari, Opera, you name it. However, it does not work AT ALL in Internet Explorer. It simply does not load any of the images, which is a big issue. I also tried "height="auto" to no avail. Any suggestions? Thanks!

Wickham
01 May 2010, 08:57 AM
First of all. add a doctype and html tag above the <head> tag:-


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>


You could use the XHTML 1.0 Strict doctype instaed. If you use the HTML 4.01 doctype the closing tag for the img tag should be > not /> and if you use the XHTML doctype the closing tag for the stylesheet link should be /> not > The above doesn't cure the problem, it's just information.

For the image in IE you need to delete the height for the img tag:-


<div id="apDiv1"><img src="images/dot1.png" width="554" /></div>
<!--height="auto" deleted-->


It then worked in my IE7.