views:

34

answers:

2

I have two divs like this

<div style="position:relative; width: 500px; overflow:auto">
         <div style="position:absolute; top:0;left:0;width:100%">
         </div>
</div>

Now the problem in IE is Scrollbars start to appear unnecessarily for the outer div. Even when i have specified the inner div's width to be 100% it extends more than it is supposed to. Works fine in Firefox, Chrome. IE is causing problems.

A: 

Try removing overflow:auto property from outer div

Sorantis
The inner div can grow vertically. in that case i want scrollbars. overflow-x does not work in IE
Kasturi
Otherwise it won't work in IE. My suggestion would be to make sure, that inner div fits the size.
Sorantis
Take a look at overflow-y:auto, but i don't guarantee it will work in every browser.
Sorantis
A: 

Try specifying a margin-right:-1px for IE only using ConditionalComments ( apply it to the AP'd el )

meder