InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

CSS transform values

  • rotate
  • scale
  • skew
  • translate
 
  • Home
  • > Tutorials
  • > CSS
  • > CSS properties
  • > CSS transform

CSS transform – skew (skewX and skewY)

on Mar 9, 2016

Using CSS3 property transform, elements can be translated, rotated, scaled and skewed in two or three dimensional space. This tutorial will covered skewing an element using CSS transform (2D) skew, skewX, skewY. Also note that when an element is skewed, it does not impact the placement of other elements in layout and may end up some gaps/overlap with other elements.

CSS Syntax:

transform:skew(ax, ay);
transform:skewX(ax);
transform:skewY(ay);

Example – transform skew()

Skew 10 degree along both X and Y axis.

<style type="text/css">
.outer {
  width: 200px; height:100px; background-color:lightgray;
}
.box1 {
  width: 100px; height:50px; background-color:green;
  transform: skew(10deg, 10deg); 
}
.box2 {
  width: 100px; height:50px; background-color:lightblue;
}
</style>

<div class="outer">
  <div class="box1">skew(10deg, 10deg)</div>
  <div class="box2">normal</div>
</div>
refresh done
try it online

Example – transform skewX

Skew 10 degree along both X axis. Note that skewX(10deg) is equivalent to skew(10deg, 0).

<style type="text/css">
.outer {
  width: 200px; height:100px; background-color:lightgray;
}
.box1 {
  width: 100px; height:50px; background-color:green;
  transform: skewX(10deg); 
}
.box2 {
  width: 100px; height:50px; background-color:lightblue;
}
</style>

<div class="outer">
  <div class="box1">skewX(10deg)</div>
  <div class="box2">normal</div>
</div>
refresh done
try it online

Example – transform skewY

Skew 10 degree along both Y axis. Note that skewY(10deg) is equivalent to skew(0, 10deg)

<style type="text/css">
.outer {
  width: 200px; height:100px; background-color:lightgray;
}
.box1 {
  width: 100px; height:50px; background-color:green;
  transform: skewY(10deg); 
}
.box2 {
  width: 100px; height:50px; background-color:lightblue;
}
</style>

<div class="outer">
  <div class="box1">skewY(10deg)</div>
  <div class="box2">normal</div>
</div>
refresh done
try it online

Specification and Browser compatibility

SpecificationStatusCategories
CSS3 2D TransformsW3C Working DraftCSS3
Desktop
ChromeFirefoxIEEdgeSafariOpera
Yes 36+ Yes 16+ Yes 10+ Yes 12+ Yes 9+ Yes 12.1+
Mobile
Android ChromeAndroid FirefoxiOS SafariIE MobileOpera Mobile
Yes 47+ Yes 44+ Yes 9.0-9.2+ Yes 10+ Yes 11+
source: caniuse.com

Suggested posts:

  1. CSS text-decoration – underline, overline and strikeout text
  2. CSS3 animation overview
  3. Rotate an element using css transform
  4. HTML5 audio tag
  5. CSS transform – translateX and translateY
  6. CSS border-width – set element border width of four sides
  7. wget handy commands
  8. CSS color values
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged CSS, CSS properties, CSS transform, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress