圆环

2017-04-22  本文已影响0人  c59ffede9db6

思路: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>
上一篇 下一篇

猜你喜欢

热点阅读