- transform:rotate()对元素进行旋转
- transform:scale()对元素进行缩放
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div{
width: 100px;
height:100px;
background-color: red;
border:1px solid black;
text-align: center;
}
#divRotate{
/*度数为正数时顺时针旋转,为负数时逆时针旋转*/
transform:rotate(45deg);
}
#divScale{
/*scale(x,y),x表示水平缩放的倍数,y表示垂直缩放的倍数。x,y大于1时表示放大,x,y属于0~1时表示缩小,当只有x的值时表示省略y,此时y的值与x的值相同*/
transform: scale(0.7,0.7);
}
</style>
</head>
<body>
<div>
<div>css3</div>
<div id="divRotate">css3</div>
<div id="divScale">css3</div>
</div>
</body>
</html>