skewY() CSS Function
Description
The skewY() CSS function is used to distort or slant an element along the vertical axis. This transformation tilts the element by a specified angle, measured in degrees, making its top and bottom edges lean either left or right while keeping the horizontal lines straight. It is particularly useful for creating dynamic visual effects, such as slanted banners, skewed buttons, or diagonal layouts, without altering the actual HTML structure.
When applied, skewY() modifies the coordinate system of the element along the Y-axis, which affects its visual rendering. Unlike rotate(), which rotates an element around a center point, skewY() only changes the vertical slant, leaving the overall width and height mostly unchanged. Multiple transformations can be combined using the transform property, allowing designers to layer effects like rotation, scaling, or translation for complex animations.
For example, you might use skewY() to create a card with a slanted header:
.card-header {
background-color: #3498db;
transform: skewY(-10deg);
color: white;
padding: 1em;
}
In this snippet, the header is slanted 10 degrees upward along the Y-axis. To keep inner content aligned, you might wrap text in a div and counter-skew it using the opposite angle. The function can be animated with transition or used in combination with animation for smooth interactive effects.
Overall, skewY() provides a simple yet powerful way to add perspective and movement to elements, giving layouts a more dynamic and modern feel.
Syntax
skewY() = transform: skewY(<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 skewY() 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
