
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
2D Transform Functions in CSS
The 2D transform functions are used to apply 2D transformations which could be rotate, move, scale and skew to an element.
Translate − To move an element along x and y axis.
Scale − To resize the element in x y direction.
Rotate − To move the element around by some degree.
Skew − To slant an element along x y direction.
Following is the code showing the 2D transform functions in CSS −
Example
<!DOCTYPE html> <html> <head> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } div { width: 100px; height: 100px; background-color: rgb(255, 0, 128); border:2px solid rgb(0, 35, 150); margin: 20px; display: inline-block; color: white; } .rotate { transform: rotate(20deg); } .translate { transform: translate(30px, 20px); } .scale { transform: scale(2, 1); margin-left:70px; } .skew { transform: skew(20deg); } </style> </head> <body> <h1>2D transform functions example</h1> <div class="rotate">ROTATE()</div> <div class="skew">SKEW()</div> <div class="scale">SCALE()</div> <div class="translate">TRANSLATE()</div> </body> </html>
Output
The above code will produce the following output −
- Related Articles
- Working with CSS3 2D Transform Functions
- Z-Transform of Exponential Functions
- Working with CSS3 3D Transform Functions
- Laplace Transform of Periodic Functions (Time Periodicity Property of Laplace Transform)
- Fourier Transform of Complex and Real Functions
- Laplace Transform of Sine and Cosine Functions
- Fourier Transform of Single-Sided Real Exponential Functions
- Fourier Transform of the Sine and Cosine Functions
- Fourier Transform of Two-Sided Real Exponential Functions
- Laplace Transform of Damped Sine and Cosine Functions
- Usage of text-transform property in CSS
- Matrix Transform in another direction with CSS
- Usage of transform property with CSS
- Animate transform property with CSS Animation
- Laplace Transform of Damped Hyperbolic Sine and Cosine Functions

Advertisements