1.4 KiB
1.4 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d78a6367417b2b2512adb | Use the CSS Transform Property skewX to Skew an Element Along the X-Axis | 0 | 使用CSS变换属性skewX沿X轴倾斜元素 |
Description
transform
属性的下一个函数是skewX()
,它将选定元素沿其X(水平)轴倾斜给定的度数。以下代码沿X轴将段落元素倾斜-32度。 p {
transform:skewX(-32deg);
}
Instructions
transform
属性将具有bottom
id的元素沿X轴倾斜24度。 Tests
tests:
- text: 具有id <code>bottom</code>的元素应沿其X轴倾斜24度。
testString: 'assert(code.match(/#bottom\s*?{\s*?.*?\s*?transform:\s*?skewX\(24deg\);/g), "The element with id <code>bottom</code> should be skewed by 24 degrees along its X-axis.");'
Challenge Seed
<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>
Solution
// solution required