skew width_skew()

skew()

The skew() CSS function is a shear mapping, or transvection, distorting each point of an element by a certain angle in each direction. It is done by increasing each coordinate by a value proportionate to the specified angle and to the distance to the origin. The more far from the origin, the more away the point is, the greater will be the value added to it.

Syntax skew(ax) or

skew(ax, ay)

Values ax Is an representing the angle to use to distort the element along the abscissa. ay Is an representing the angle to use to distort the element along the ordinate. Cartesian coordinates on ℝ2 Homogeneous coordinates on ℝℙ2 Cartesian coordinates on ℝ3 Homogeneous coordinates on ℝℙ3 1tan(ax)tan(ay)1 1tan(ax)0tan(ay)10001 1tan(ax)0tan(ay)10001 1tan(ax)00tan(ay)10000100001

[1 tan(ay) tan(ax) 1 0 0]

Examples

Using a single x-angle

HTML

foo

bar

CSS p {

width: 50px;

height: 50px;

background-color: teal;

}

.transformed {

/* the same as skewX(10deg); */

transform: skew(10deg);

background-color: blue;

}

Result

Using two angles

HTML

foo

bar

CSS p {

width: 50px;

height: 50px;

background-color: teal;

}

.transformed {

transform: skew(10deg, 10deg);

background-color: blue;

}

Result

© 2005–2017 Mozilla Developer Network and individual contributors.

Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.

https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skew

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值