...

View Full Version : IE <img> stretches even if width:auto;



kenshn111
05-15-2011, 10:48 AM
http://i.imgur.com/iJoft.png

First: Chrome;
Second: IE 8.0.7600.16385 64-bit Edition;
Third: Firefox 4.

They are images btw. :)
Here's my CSS

#test1 {
padding-left:12px;
margin-right:20px;
position:relative;
float:left;
z-index:50;
width:auto;
height:100%;
}

#test3 {
padding-left:12px;
margin-right:20px;
position:relative;
float:left;
z-index:50;
width:auto;
height:auto;
}
Here's my code:

<div id="wushu">
<div id="test1">
asldka
</div>
<div id="test3" style="display:none;">
<img src="./style/select1.png" alt="" style="">
<div class="show">aslsssssssdk</div>
</div>
</div>

Can somebody help me with this?

VIPStephan
05-15-2011, 11:54 AM
Do you have any script in your page (like e. g. superleight) that could interfere with your image?

kenshn111
05-15-2011, 04:18 PM
I don't think that there is any..
no, I don't have any scripts that could interfere my img in IE.

SKY-ProToSs
05-15-2011, 10:00 PM
I don't think that there is any..
no, I don't have any scripts that could interfere my img in IE.

don't use width: auto; and why z-index

All you need to do is put the image inside the div, from what I'm seeing.

No width or height or anything else are required for this.

The div will stretch on it's own if you have html elements inside of it.

tyealia
07-13-2011, 10:58 PM
I have been having the exact same problem with my webpage extending horizontally in IE, my ie is the newest ie9. No solution as of yet, seems like it just expands every page a few points. I have heights and width set to each div to match the background image I am using for them



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum