Solved

CSS, image size 100% and Internet Explorer

Posted on 2012-04-05
2
177 Views
Last Modified: 2012-04-28
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%}
0
Comment
Question by:christer200
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
Dewmec earned 500 total points
ID: 37822330
Hi christer200,

I am hoping that I have an easy fix for you at first glance. You don't have the ending tags for the lines on both of your width properties, which may be causing the issue in IE and not the other browsers. What I mean by ending tag is shown below:

width:100%;}

Open in new window


with the " ; " added, instead of

width:100%}

Open in new window


as you currently have it. I hope this helps.
0
 
LVL 7

Expert Comment

by:Dewmec
ID: 37822342
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question