CSS skewY() Function
skewY() function is used to skew elements in a two-dimensional space along the y-axis.
skewY() element performs a shear transformation (also known as a shear mapping or a transvection), which displaces each point of an element by a given angle along the y-axis.
Skewing an element is kind of like taking the points of an element, and pushing or pulling them in different directions, based on a given angle.
skewY() function works like this:
skewY() function accepts one argument which specifies the angle of the skew for the y-axis. This can be any valid angle value.
Here's an example of using
You can also provide negative values if required.
In the previous examples, I use
transform-origin to adjust the origin of the transformation.
This is optional, so you can leave it out if required (or change the value).
The default origin for the rotation is
50% 50% (i.e. the center). Therefore, if we remove this property, the image will transform based on this value.
So here's an example of what the previous example looks like when using the default
The official syntax of the
skewY() function is as follows:
skewY() function accepts a parameter that defines the angle of the skew operation.
The angle can be represented by any valid angle value, which can be represented with any of the following unit identifiers:
- Degrees. There are 360 degrees in a full circle.
- Gradians, also known as "gons" or "grades" (although these aren't valid unit identifiers — you should still use
gradas the unit identifier). There are 400 gradians in a full circle.
- Radians. There are 2Ï€ radians in a full circle.
- Turns. There is 1 turn in a full circle.
The unit identifier is optional for zero angles. For example, both
skew(0) are valid (but
skew(45) is not).
skewY()function is defined in CSS Transforms Module Level 1 (W3C Working Draft)
The following table provided by Caniuse.com shows the level of browser support for this feature.