In CSS3, you can use the transform function to achieve the rotation, scaling, tilt, and movement of the text or image four types of deformation processing

Source: Internet
Author: User

Deformation treatment in CSS3 (transform) belongs to transform function classification 1. Rotation

Transform:rotate (45DEG);

The statement rotates the DIV element 45 degrees clockwise. DEG is an angular unit defined in the "Values and Units" module of CSS 3.

2. Zooming

Transform:scale (0.8,1);

Use the Zoom method to achieve the zoom effect of the text or image, specifying the magnification in the parameters. The statement uses the scale method to reduce the element horizontally by 20%, without scaling in the vertical direction.

3. Tilt

Transform:skew (30DEG,0DEG);

In this example, the skew method is used to tilt the element horizontally to 30 degrees and the disposition direction remains unchanged.

4. Mobile

Translate (50px,50px);

Use the Translate method to move text or images vertically 50 pixels in both horizontal and vertical directions.

Specify a datum point for the transformation

When you use the Transform method to deform a text or an image, the center point of the element is the datum point. Using the Transform-orign property, you can change the datum point of the deformation.

Transorm-origin:left Bottom;

Left and bottom are the positions of the datum points in the horizontal and vertical directions of the element.

Use multiple transformation methods on an element

Transform:rotate (45deg) scale (1.5) translate (50px,0px);

In this synthetic example, the text or image is rotated 45 degrees, then scaled 1.5 times times, finally moving horizontally 150 pixels, moving in the vertical direction 200 pixels.

Currently the Transform property needs to add a "-webkit-" prefix on the WebKit engine's Web browser, and the "-moz-" prefix needs to be added to the Fifefox browser, and the "-o-" prefix needs to be added to the Opera browser.

In CSS3, you can use the transform function to achieve the rotation, scaling, tilt, and movement of the text or image four types of deformation processing

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.