CSS skewX()

Y1dne's avatar
Published Feb 19, 2026

skewX() is a CSS transform function that skews an element along the x-axis by the specified angle. It distorts the element horizontally, shifting its top and bottom edges left or right while preserving its vertical orientation.

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • In this CSS tutorial, you’ll learn how to add CSS to visually transform HTML into eye-catching sites.
    • Beginner Friendly.
      6 hours

Syntax

transform: skewX(<value>);

Parameters:

  • <angle>: Specifies the skew amount. Accepts any valid CSS angle unit:
    • Degrees (deg)
    • Radians (rad)
    • Gradians (grad)
    • Turns (turn)

The value may be positive or negative.

Return value:

None. This function produces a transform value that modifies the element’s rendering when applied through the transform property.

Example 1: Skewing by Degrees

In this example, the element is skewed horizontally by 30deg:

.box {
width: 50px;
height: 60px;
background-color: red;
transform: skewX(30deg);
}

The output of the code above is shown below:

A box element skewed 30 degrees along the x-axis by CSS skewX function

Example 2: Skewing by Turns

In this example, the element is skewed horizontally by -0.2turn:

.box {
width: 50px;
height: 60px;
background-color: red;
transform: skewX(-0.2turn);
}

The output of the code above is shown below:

A box element skewed -0.2 turns along the x-axis by CSS skewX function

All contributors

Learn CSS on Codecademy

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • In this CSS tutorial, you’ll learn how to add CSS to visually transform HTML into eye-catching sites.
    • Beginner Friendly.
      6 hours