christer200
asked on
CSS, image size 100% and Internet Explorer
I have images that are 100% width and height using CSS. This works beautiful in FireFox, Chrome and most browsers, but not Internet Explorer (9). The problem in IE is that the 100% width seems to be 100% width of the screen and not the browser window. So if I have the browser window in IE at maybe 50% of the screen, the image is stretched way beyond the browser window.
Below it is the logo that I want to stretch 100% in height and width.
<body bgcolor="#635a49" onload="MM_preloadImages(' ../im/home _d.gif','. ./im/innov ation_d.gi f','../im/ products_d .gif','../ im/news_d. gif','../i m/warranty _d.gif','. ./im/deale rlocator_d .gif','../ im/contact _d.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#212121"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#000000"><div id="logodiv"><img src="../im/factory-logo2.j pg" class="logostr"/></div></t d>
</tr>
<tr>
This is the CSS
.logodiv {
height:100%;
width:100%}
.logostr {
height:100%;
width:100%}
Below it is the logo that I want to stretch 100% in height and width.
<body bgcolor="#635a49" onload="MM_preloadImages('
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#212121"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#000000"><div id="logodiv"><img src="../im/factory-logo2.j
</tr>
<tr>
This is the CSS
.logodiv {
height:100%;
width:100%}
.logostr {
height:100%;
width:100%}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
P.S. Also, make sure you have an ending tag for table ... </table>. I'm sure you already do and it was just not part of the code you posted. Adding those couple of things to the code allows it to work properly for me at any size on the screen in the IE9 browser.