skew() CSS Function
Description
The skew() CSS function is used to distort an element along its X and Y axes, creating a slanted or skewed effect. Unlike rotation, which spins an element around a fixed point, skew() stretches the element in a way that angles its sides without altering its overall position in the layout. This function is often applied via the transform property.
You can provide different angles for the X and Y axes, allowing for horizontal, vertical, or diagonal skewing. If only one value is specified, the other axis defaults to 0°, meaning no skew. Positive values tilt the element in one direction, while negative values tilt it in the opposite direction.
Using skew() is particularly useful for creating dynamic UI elements, buttons, banners, or backgrounds that appear more visually engaging. For example, combining skew() with transition can produce smooth hover effects where the element gradually slants when interacted with.
Example:
<div class="skew-box">Skewed Box</div>
.skew-box {
width: 200px;
height: 100px;
background-color: #4CAF50;
color: white;
display: flex;
align-items: center;
justify-content: center;
transform: skew(20deg, 10deg);
}
Tips and notes:
skew()affects the visual appearance of an element but does not change its layout dimensions for other elements.- It works well with
transform-originto control the pivot point of the skew. - Can be combined with other
transformfunctions such asrotate()orscale()for more complex effects.
Syntax
skew() = transform: skew(<angleX> [, <angleY>]?);
Values
- <angleX>Sets the horizontal angle. A positive value tilts to the left, a negative value to the right.
- <angleY>Sets the vertical angle of inclination. A positive value tilts down, a negative value up. If no value is specified, then the default value is 0 and no vertical distortion occurs.
Example
Browser Support
The following information will show you the current browser support for the CSS skew() 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: 1st January 2026
