思路:div套div的形式,这样transform-origin就不会变
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<style type="text/css">
.box{
width: 100px;
height: 100px;
border-radius: 50px;
background: red;
}
.box1
{
width: 100px;
height: 100px;
border-radius: 50px;
background:blue;
transform: scale(0.5,0.5);
}
.box2{
width: 100px;
height: 100px;
border-radius: 50px;
background:#f60;
transform: scale(.8,0.8);
}
</style>
</head>
<body>
<div class="box">
<div class="box1">
<div class="box2">
</div>
</div>
</div>
</body>
</html>
网友评论