1.3 KiB
1.3 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d78a6367417b2b2512adc | Use the CSS Transform Property skewY to Skew an Element Along the Y-Axis | 0 | 使用CSS变换属性skewY沿Y轴倾斜元素 |
Description
skewX()
函数沿X轴将选定元素倾斜给定的度数,则skewY()
属性沿Y(垂直)轴倾斜元素skewY()
不足为奇了。 Instructions
transform
属性,沿Y轴倾斜top
-10度的元素。 Tests
tests:
- text: id <code>top</code>的元素应沿其Y轴倾斜-10度。
testString: 'assert(code.match(/#top\s*?{\s*?.*?\s*?transform:\s*?skewY\(-10deg\);/g), "The element with id <code>top</code> should be skewed by -10 degrees along its Y-axis.");'
Challenge Seed
<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>
Solution
// solution required