Link to home
Start Free TrialLog in
Avatar of christer200
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/innovation_d.gif','../im/products_d.gif','../im/news_d.gif','../im/warranty_d.gif','../im/dealerlocator_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.jpg"   class="logostr"/></div></td>
      </tr>
      <tr>


 This is the CSS
                  
                   .logodiv {
            height:100%;
            width:100%}
       .logostr {
            height:100%;
            width:100%}
ASKER CERTIFIED SOLUTION
Avatar of Dewmec
Dewmec
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.