transform

transform属性:变换,一般使用4个值,分别是skew扭曲,translate位移,rotate比旋转,scale比例缩放

练习代码如下:

<!DOCTYPE html>
<html>
<head>
<title>transform</title>
<meta charset="utf-8">
<style type="text/css">
div{margin: 80px auto;height: 120px;width:120px;border:5px solid red;transform-style: preserve-3d;text-align: center; line-height: 100px;}
div:nth-child(1):hover{
transform: skew(30deg);
}
div:nth-child(2):hover{
transform: scale(2);
}
div:nth-child(3):hover{
transform: rotate(45deg);
}
div:nth-child(4):hover{
transform: translate(20px,20px);
}
</style>
</head>
<body>
<div title="我默认skewX扭曲">skew扭曲</div>
<div title="我会放大一倍">scale比例缩放</div>
<div title="我会顺时针旋转45度,正值顺时针,负值逆时针">rotate旋转</div>
<div title="我会向右下角位移20px">translate位移</div>
</body>
</html>

转载于:https://www.cnblogs.com/KJ-Z/p/5662427.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值