Reputation: 4849
I have created a dialog box ( a div with position:absolute) if any element inside the box has a float : right the width of the box goes to 100% of the screen in IE7
float :left does not affect it. this problem is specific to ie7
thank you for your help
Upvotes: 3
Views: 3711
Reputation: 182
Instead of float:right;
on the inner block, you can use text-align:right;
on the parent block. See example:
<div style="position:absolute; text-align:right;">
<div style="float:left;">
123
</div>
<div>
456
</div>
</div>
It looks like this: http://jsfiddle.net/XLnYJ/49/
Tested on: ie 6 & 7; firefox; opera; gchrome.
Upvotes: 2
Reputation: 2995
You absolutely have to set the width of an absolutely positioned element if it contains an element floated right to get it to behave properly.
Upvotes: 3