Help - Search - Members - Calendar
Full Version: Image width issue in IE6
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
eexposito
I am trying to fill a td completely with a 1x1 red_dot.gif and get some strange results. In IE6 I get a 1 pixel space at the end of the td when the width for my td.innerBar and image width are both 100px. If I make them both 99px then the td is filled completely and don't have the 1 pixel space. Don't have this issue in Firefox only IE6. Any way around this?

Code that doesn't work in IE6:

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<style>
td.InnerBar { padding: 0px; margin: 0px; height: 13px; width: 100px;border: solid 1px black;}
img.InnerBar { height: 13px; padding: 0px; margin: 0px;}
</style>
</head><body>
<table border='0' cellpadding="0" cellspacing="0"><tr><td><table><tr><td class='InnerBar'><img class='InnerBar' src='images/common/red_dot.gif' width='100px'/></td></tr></table></td></tr></table>
</body></html>


Code that works in IE6:

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<style>
td.InnerBar { padding: 0px; margin: 0px; height: 13px; width: 99px;border: solid 1px black;}
img.InnerBar { height: 13px; padding: 0px; margin: 0px;}
</style>
</head><body>
<table border='0' cellpadding="0" cellspacing="0"><tr><td><table><tr><td class='InnerBar'><img class='InnerBar' src='images/common/red_dot.gif' width='99px'/></td></tr></table></td></tr></table>
</body></html>


Added screenshot as attachment as well.

Thanks in advance for any help,
EE
Click to view attachment
Darin McGrew
The width attribute of the img element takes an integer (number of pixels) or a percentage value (a percentage of the available space). You're trying to use a CSS-style number-with-units value.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.