Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6757057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:36:03+00:00 2026-05-26T13:36:03+00:00

So i have the following code on my img’s width:100%; height: auto; However IE6

  • 0

So i have the following code on my img’s

width:100%; height: auto;

However IE6 being infamous for conforming to web-standards seems to ignore the aspect ratio, it adds a default aspect ratio onto the image and makes them look hidious, it stretches them and squashes them in some instances it loads them correctly but it’s not consistent.

The html looks like this

<div 100% width of window>
     <div 100% with some margin>
          <img that looks great in IE (yeah right..) />
     </div>
</div>

An image that is supposed to be 1140px by 392px is displayed at 1140px by 1303px

Width seems to be correct but the height is getting distorted.

Do you know of a fix?

I understand that IE6 is on the way-out but with some countries in the world with over 28% of usage and corporations it is still important to support it in some instances.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:36:04+00:00Added an answer on May 26, 2026 at 1:36 pm
    #yourImgage {
        width:100%; height: auto;
    }
    

    it stretches them and squashes them in some instances it loads them
    correctly but it’s not consistent.

    Your code above is not telling the image to be 100% of itself, but rather 100% of it’s container’s width. If that’s what you want, then fine. Otherwise, by stretching, it sounds like IE is just doing what it’s told albeit that it seems to be confused about what to do with height:auto… preserve the image’s aspect ratio or keep it’s original pixel height while stretching its width.

    So have you tried leaving out height entirely? It seems to behave the same in other browsers, perhaps it will eliminate IE 6’s confusion…

    #yourImgage {
        width:100%;
    }
    

    What are you trying to achieve here?


    EDIT:

    Perhaps you’ll need to maintain a conditional stylesheet just for IE 6. All other browsers will ignore this.

    <!--[if IE 6]>
        <link rel="stylesheet" type="text/css" href="ie6-only.css" />       
    <![endif]-->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code being echoed: [caption id=attachment_13 align=alignnone width=235 caption=Event 1] <img
I have the following code: <div style=width:100% align=center> <img src=./platform-logos-big.png alt=Icons of platforms we
I have the following code: <div id=conteudo> <img id=logo height=137 width=327 /> <div id=data_hora>
I have the following code: var images = document.getElementsByTagName('img'); if (screen.width > 640) {
I have the following code $body = preg_replace('/<img(.*?)src=(.+)/Ui','<img src=renderImage.php?image=\\2&width=<?=$img_width?>&url=<?=$mobiURL?>',$body); $body contains a whole html
I have the following code: <div style=width: 150px> <div style=padding: 5px> <img src=http://xenforomods.info/styles/Silent/xenforo/browser/announcementIcon.png width=50px
I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
Just a (hopefully) quick question, I have the following HTML code: <tr> <td><img src=img/icons/file_pdf.png></td>
I have the following code img.after('<li></li>'); Which works correctly and add the li element.
I have the following code: if (el.nodeName == 'IMG'){ e1.addEventListener('click', function(e) { el.id =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.