At present, more and more browsers are compatible with the css3 standard, and even the older brother of IE browser has begun to bow to css3. Microsoft announced that ie9 supports more css3 attributes, and ie9 focuses more on HTML5 standards. However, in css3, there is a property transform rotate that rotates objects. It is said that browsers compatible with css3 do not support it well, fortunately, Firefox, WebKit, and opera all provide official hack to support this attribute. In ie, the transform attribute cannot be implemented only in general CSS format.
In W3C standard, the method for rotating an object through the transform attribute is as follows: Transform: Rotate (40deg);/* where 40 is the Rotation Angle */
However, because almost all browsers currently have low rendering efficiency for this attribute, we can use the following hack to improve rendering efficiency:
-O-transform: Rotate (40deg);/* operabrowser */
-WebKit-transform: Rotate (40deg);/* WebKit kernel browser */
-Moz-transform: Rotate (40deg);/* Firefox */
Currently, all versions of IE are not compatible with css3, so we can only implement it through the CSS Filter of IE. The statement is as follows:
Filter: progid: DXImageTransform. Microsoft. Matrix (sizingmethod = 'Auto expand', M11 = 0.7660444431189777, M12 =-0.6427876096865394, m21 = 0.6427876096865398, m22 = 0.7660444431189779 )";
You can see this demo:
<! Doctype HTML>
<HTML lang = "en">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> demonstration of CSS transform rotation attributes in IE </title>
<Meta http-equiv = "X-UA-compatible" content = "Ie = emulateie8"/>
<Style type = "text/CSS">
Body {font-family: "Arial", sans-serif ;}
# Ptofref {border: #000 solid 3px; Background: # 6ff; width: 204px; Height: 204px; position: absolute; top: 100px; left: 100px ;} # example {position: absolute; top: 100px; left: 100px; Border: # 09f solid 1px; Background: # f90; font-weight: 900;
Color: # FFF; padding: 10px; display: block; width: 200px; Height: 200px; margin-top:-1px; margin-left:-1px; transform: rotate (40deg);-o-transform: Rotate (40deg );
-WebKit-transform: Rotate (40deg );
-Moz-transform: Rotate (40deg );
Filter: progid: DXImageTransform. Microsoft. Matrix (sizingmethod = 'Auto expand', M11 = 0.7660444431189777, M12 =-0.6427876096865394, m21 = 0.6427876096865398, m22 = 0.7660444431189779 )";}
</Style>
<! -- [If IE]>
<Style type = "text/CSS">
# Example {top: 50px; left: 50px ;}
</Style>
<! [Endif] -->
</Head>
<Body>
<Div id = "ptofref"> </div>
<Div id = "example"> This is a demonstration of CSS rotation attributes </div>.
</Body>
</Html>