Favorites

skewY() CSS Function

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

The skewY() transform function slants an element vertically by an angle, such as skewY(15deg).

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 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.

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: skewY(0);
}

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

<div class="container">
<div class="skew-box">
<h2>Skewed Element</h2>
<p>This box is tilted 10 degrees using skewY.</p>
</div>
</div>
/* Center the example on the page */
.container {
display: flex;
justify-content: center;
align-items: center;
height: 300px;
background-color: #f0f0f0;
}

.skew-box {
width: 250px;
padding: 20px;
background-color: #3498db;
color: white;
text-align: center;
border-radius: 8px;

/* Apply the skew transformation */
transform: skewY(-10deg);

/* Optional: Smooth transition if you want to animate it later */
transition: transform 0.3s ease;
}

/* Optional: Invert the skew for the text inside
so the text stays readable and upright */
.skew-box h2, .skew-box p {
transform: skewY(10deg);
}
Open in editor

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

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.