2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
id: 587d78a6367417b2b2512adc
|
|
|
|
title: Use the CSS Transform Property skewY to Skew an Element Along the Y-Axis
|
|
|
|
challengeType: 0
|
2020-02-11 15:46:34 +08:00
|
|
|
videoUrl: 'https://scrimba.com/c/c2MZ2uB'
|
|
|
|
forumTopicId: 301075
|
|
|
|
localeTitle: 使用 CSS Transform skex 属性沿Y轴倾斜元素
|
2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
2020-02-11 15:46:34 +08:00
|
|
|
<section id='description'>
|
|
|
|
<code>skewX</code> 函数使指定元素沿 X 轴翻转指定的角度,想必你已经猜到了,<code>skewY</code> 属性使指定元素沿 Y 轴(垂直方向)翻转指定角度。
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
## Instructions
|
2020-02-11 15:46:34 +08:00
|
|
|
<section id='instructions'>
|
|
|
|
使用 <code>transform</code> 属性沿 Y 轴翻转 id 为 <code>top</code> 的元素 -10 度。
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
tests:
|
2020-02-11 15:46:34 +08:00
|
|
|
- text: 'id 为 <code>top</code> 的元素应该沿着 Y 轴翻转 -10 度。'
|
|
|
|
testString: 'assert(code.match(/#top\s*?{\s*?.*?\s*?transform:\s*?skewY\(-10deg\);/g), ''id 为 <code>top</code> 的元素应该沿着 Y 轴翻转 -10 度。'');'
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='html-seed'>
|
|
|
|
|
|
|
|
```html
|
|
|
|
<style>
|
2020-02-11 15:46:34 +08:00
|
|
|
div {
|
2018-10-10 18:03:03 -04:00
|
|
|
width: 70%;
|
|
|
|
height: 100px;
|
|
|
|
margin: 50px auto;
|
|
|
|
}
|
|
|
|
#top {
|
|
|
|
background-color: red;
|
2020-02-11 15:46:34 +08:00
|
|
|
|
2018-10-10 18:03:03 -04:00
|
|
|
}
|
|
|
|
#bottom {
|
|
|
|
background-color: blue;
|
|
|
|
transform: skewX(24deg);
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<div id="top"></div>
|
|
|
|
<div id="bottom"></div>
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
2020-02-11 15:46:34 +08:00
|
|
|
|
|
|
|
```html
|
2018-10-10 18:03:03 -04:00
|
|
|
// solution required
|
|
|
|
```
|
2020-02-11 15:46:34 +08:00
|
|
|
|
2018-10-10 18:03:03 -04:00
|
|
|
</section>
|
2020-02-11 15:46:34 +08:00
|
|
|
|