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

1.4 KiB
Raw Blame History

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 {
transformskewX-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