單詞
transform 改變形態 rotate 旋轉 scale 規模
transform 屬性
設置元素變形
scale屬性值:設置元素縮放
image.png
image.png
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8"/>
<style>
div {
width: 200px;
height: 200px;
background-color: green;
}
div:hover {
transform: scale(0.5,2)
}
</style>
</head>
<body>
<div></div>
</body>
</html>
rotate屬性值:設置元素旋轉
image.png
image.png
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8"/>
<style>
div{
width:200px;
height:200px;
background-color:green;
margin:100px auto;
transform:rotate(45deg);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
效果如下:
image.png