views:

48

answers:

1

I've looked all over for more information on this, and would like to know why it happens.

Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html>
<head>
</head>
<body>
    <div style="position:absolute; top:200px; left:200px; height:200px; width:200px; border:1px solid black; filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.9886188373396114, M12=-0.15044199698646263, M21=0.15044199698646263, M22=0.9886188373396114);">
        <div style="position:absolute; top:10px; left:10px; border:1px solid darkblue;">
            I do not rotate in IE 8.
        </div>
    </div>
</body>
</html>

The problem is that absolutely or relatively positioned elements within a div that has been rotated using MS's dximagetransform.matrix do not inherit the transformation in IE 8.

IE 6 & 7 render correctly, and I can solve the IE8 problem by triggering compatibility mode, but I'd rather not do that. Does anyone have any experience with this? I'm using css3 transform on other browsers and using dximagetransform.matrix to achieve this effect in IE.

EDIT: Added the opening html tag. Problem still exists.

http://i45.tinypic.com/nf4gmq.png

A: 

I think the position absolute stops the filter from inheriting. I found the same thing when I was experimenting with blur filters recently, except in that case I wanted a way to make the filters stop inheriting. I hadn't realised IE8 was different from IE6/7 in this respect.

Is this the effect you're trying to get?

Rotate in IE8 using margin instead of position

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html>
<head>
</head>
<body>
    <div style="position:absolute; top:200px; left:200px; height:200px; width:200px; border:1px solid black; filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.9886188373396114, M12=-0.15044199698646263, M21=0.15044199698646263, M22=0.9886188373396114);">
        <div style="margin-top:10px; margin-left:10px; border:1px solid darkblue;">
            I do not rotate in IE 8.
        </div>
    </div>
</body>
</html>

Of course, if you needed the child element absolutely position for a specific reason you may be out of luck (might be able to achieve something with floats, but it would depend exactly what you needed).

robertc
Hi RobertC, if that were true, how come I'm seeing partial implementation? Did you try your suggestion? When I try it, the issue still remains. In fact, it seems worse since it's now rotating off axis.http://tinypic.com/r/2dhis95/6
davydka
Sorry, I misunderstood your issue.
robertc
Edited: I've tried answering the question you actually asked this time.
robertc
Hi RobertC, Thank you for your replies. That is the effect I am going for. Floats are an interesting idea. Forcing 'Compatibility Mode' also solves the problem. This can be done by putting the following meta tag in the header.<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >So, the real question I'm wondering is: Should this different/newer rendering in IE8 be considered more "correct", or should it be considered a bug?
davydka
I think I prefer having a way to 'turn off' filters on descendent elements and still be able to position relative to the containing block, but I'm not sure if it's compatible with the way CSS transforms work in other browsers.
robertc
Yeah, in the introduction of the spec: "Any value other than ‘none’ for the transform results in the creation of both a stacking context and a containing block. The object acts as a containing block for fixed positioned descendants." I think what IE6/7 is doing is 'more correct' in the sense that they more closely match the standard for transforms but, of course, when you're using proprietary browser extensions 'more correct' doesn't really apply.
robertc
Excellent. Is clears things up for me. Thanks!
davydka