Favorites

skew() CSS Function

skew()
CSS FunctionThis function is supported by all modern browsers.
Updated 21st November 2026

The skew() transform function slants an element along the X and Y axes by angles, such as skew(20deg, 10deg).

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

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.

Interactive Demo

Transform
Demo Code
HTML Code
<div class="demo-area">
	<div class="demo-ghost"></div>
	<div class="demo-element">Transform</div>
</div>
CSS Code
.demo-area {
	position: relative;
	width: 300px;
	height: 190px;
	background: #f4f4f4;
	outline: 1px dashed #b0b0b0;
}
.demo-ghost, .demo-element {
	position: absolute;
	left: 100px;
	top: 55px;
	width: 100px;
	height: 80px;
	box-sizing: border-box;
}
.demo-ghost {
	border: 2px dashed #b0b0b0;
}
.demo-element {
	padding: 8px;
	background: rgb(247 37 133 / 85%);
	color: #fff;
	font-size: 14px;
	transform: skew(0);
}

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

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.