-WebKit-transform: Rotate (40deg );

Source: Internet
Author: User

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>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.