Which of the following transform property value defines a 2D skew transformation along the X- and the Y-axis?

skewX(angle)
skewY(angle)
skew(x-angle,y-angle)
none of the mentioned

The correct answer is C. skew(x-angle,y-angle).

A skew transformation is a 2D transformation that causes an object to be stretched along one axis and compressed along the other. The amount of skew is specified by two angles, one for the X-axis and one for the Y-axis.

The skewX(angle) property only specifies a skew along the X-axis, while the skewY(angle) property only specifies a skew along the Y-axis. Therefore, neither of these properties can be used to define a 2D skew transformation along the X- and the Y-axis.

The skew(x-angle,y-angle) property, on the other hand, can be used to define a 2D skew transformation along the X- and the Y-axis. This is because it specifies both the X-axis skew angle and the Y-axis skew angle.

For example, the following code will skew an image by 10 degrees along the X-axis and 20 degrees along the Y-axis:

image.transform = "skew(10,20)";

Exit mobile version