* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
78 lines
1.3 KiB
Markdown
78 lines
1.3 KiB
Markdown
---
|
||
id: 587d78a6367417b2b2512adb
|
||
title: 使用 CSS Transform skex 属性沿X轴倾斜元素
|
||
challengeType: 0
|
||
videoUrl: 'https://scrimba.com/c/cyLP8Sr'
|
||
forumTopicId: 301074
|
||
dashedName: use-the-css-transform-property-skewx-to-skew-an-element-along-the-x-axis
|
||
---
|
||
|
||
# --description--
|
||
|
||
接下来要介绍的 `transform` 属性是 `skewX`:`skewX` 使选择的元素沿着 X 轴(横向)翻转指定的角度。
|
||
|
||
下面的代码沿着 X 轴翻转 `p` 元素 -32 度。
|
||
|
||
```css
|
||
p {
|
||
transform: skewX(-32deg);
|
||
}
|
||
```
|
||
|
||
# --instructions--
|
||
|
||
使用 `transform` 属性沿 X 轴翻转 id 为 `bottom` 的元素 24 度。
|
||
|
||
# --hints--
|
||
|
||
id 为 `bottom` 的元素应该沿着 X 轴翻转 24 度。
|
||
|
||
```js
|
||
assert(code.match(/#bottom\s*?{\s*?.*?\s*?transform:\s*?skewX\(24deg\);/g));
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```html
|
||
<style>
|
||
div {
|
||
width: 70%;
|
||
height: 100px;
|
||
margin: 50px auto;
|
||
}
|
||
#top {
|
||
background-color: red;
|
||
}
|
||
#bottom {
|
||
background-color: blue;
|
||
|
||
}
|
||
</style>
|
||
|
||
<div id="top"></div>
|
||
<div id="bottom"></div>
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```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>
|
||
```
|