freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-css-transform-prope...

1.3 KiB
Raw Blame History

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