2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Use the CSS Transform Property skewY to Skew an Element Along the Y-Axis
|
|
|
|
---
|
|
|
|
## Use the CSS Transform Property skewY to Skew an Element Along the Y-Axis
|
|
|
|
|
2019-03-20 03:42:33 +05:30
|
|
|
### Solution
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-03-20 03:42:33 +05:30
|
|
|
```html
|
|
|
|
<style>
|
|
|
|
div {
|
|
|
|
width: 70%;
|
|
|
|
height: 100px;
|
|
|
|
margin: 50px auto;
|
|
|
|
}
|
|
|
|
#top {
|
|
|
|
background-color: red;
|
|
|
|
transform: skewY(-10deg);
|
|
|
|
}
|
|
|
|
#bottom {
|
|
|
|
background-color: blue;
|
|
|
|
transform: skewX(24deg);
|
|
|
|
}
|
|
|
|
</style>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-03-20 03:42:33 +05:30
|
|
|
<div id="top"></div>
|
|
|
|
<div id="bottom"></div>
|
|
|
|
```
|