2018-09-30 23:01:58 +01:00
---
id: 587d78a6367417b2b2512adb
title: Use the CSS Transform Property skewX to Skew an Element Along the X-Axis
challengeType: 0
videoUrl: 'https://scrimba.com/c/cyLP8Sr'
---
## Description
< section id = 'description' >
The next function of the < code > transform< / code > property is < code > skewX()< / code > , which skews the selected element along its X (horizontal) axis by a given degree.
The following code skews the paragraph element by -32 degrees along the X-axis.
2019-05-14 01:11:58 -07:00
```css
p {
transform: skewX(-32deg);
}
```
2018-09-30 23:01:58 +01:00
< / section >
## Instructions
< section id = 'instructions' >
Skew the element with the id of < code > bottom< / code > by 24 degrees along the X-axis by using the < code > transform< / code > property.
< / section >
## Tests
< section id = 'tests' >
```yml
2018-10-04 14:37:37 +01:00
tests:
- text: The element with id < code > bottom</ code > should be skewed by 24 degrees along its X-axis.
2019-07-24 02:42:26 -07:00
testString: assert(code.match(/#bottom \s*?{\s*?.*?\s*?transform:\s*?skewX\(24deg\);/g));
2018-09-30 23:01:58 +01:00
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'html-seed' >
```html
< style >
2018-10-08 01:01:53 +01:00
div {
2018-09-30 23:01:58 +01:00
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
}
#bottom {
background-color: blue;
2018-10-08 01:01:53 +01:00
2018-09-30 23:01:58 +01:00
}
< / style >
< div id = "top" > < / div >
< div id = "bottom" > < / div >
```
< / div >
< / section >
## Solution
< section id = 'solution' >
2019-04-29 01:13:38 +07:00
```html
< style >
div {
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
}
#bottom {
background-color: blue;
transform: skewX(24deg);
}
< / style >
< div id = "top" > < / div >
< div id = "bottom" > < / div >
2018-09-30 23:01:58 +01:00
```
< / section >