CSS Portal

skew() CSS Function

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
skew()
CSS FunctionThis function is supported by all modern browsers.
Updated 1st January 2026

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-origin to control the pivot point of the skew.
  • Can be combined with other transform functions such as rotate() or scale() 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.
One value sets the slope of the element only horizontally. Two values ​​set the slope of the element horizontally and vertically independently. A value of 0 leaves the element without distortion.

Example

<div class="container">
<div class="skew-box">
SKEW ME
</div>
</div>
/* Center the example on the page */
.container {
display: flex;
justify-content: center;
align-items: center;
height: 300px;
background-color: #f0f0f0;
}

/* The element being skewed */
.skew-box {
width: 150px;
height: 150px;
background-color: #3498db;
color: white;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
font-family: sans-serif;

/* Applying the skew */
/* transform: skew(X-axis, Y-axis) */
transform: skew(20deg, 10deg);

/* Smooth transition for hover effect */
transition: transform 0.3s ease;
}

/* Hover effect to show the difference */
.skew-box:hover {
transform: skew(0deg, 0deg);
background-color: #2ecc71;
}
Open in editor

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

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee