skewX() CSS Function
Description
The skewX() CSS function is used to apply a 2D skew transformation along the horizontal (X) axis of an element, effectively slanting the element’s shape to the left or right while keeping its vertical dimensions unchanged. This transformation can create dynamic visual effects, such as angled text, tilted buttons, or creative card designs. Unlike transform properties like rotate() which rotate elements around a pivot point, skewX() specifically distorts the element along the X-axis based on the angle you provide. Positive angles tilt the element to the right, while negative angles tilt it to the left.
It is commonly used in combination with other transform functions such as skewY() or scale() to create more complex transformations. Additionally, it can be animated using transition or animation to produce smooth interactive effects.
For example, you might use it to tilt a div card slightly when hovered:
.card {
transform: skewX(15deg);
transition: transform 0.3s ease;
}
.card:hover {
transform: skewX(0deg);
}
This creates a visually appealing effect where the card appears slanted initially and straightens when hovered, drawing attention to interactive elements.
The skewX() function is especially useful in modern UI design where subtle angles can add depth and dynamism without affecting layout flow, unlike transformations that modify size or rotation.
Syntax
skewX() = transform: skewX(<angle>);
Values
- <angle>The angle is taken as the value. A positive value tilts to the left, a negative value to the right. A value of 0 leaves the element without distortion.
Example
Browser Support
The following information will show you the current browser support for the CSS skewX() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
This function is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 31st December 2025
