css3实现扇形旋转

css样式代码:
.big{
            width: 500px;
            height: 500px;
            border: 3px solid #000;
            margin: 100px auto;
            position: relative;
        }
        .small{
            width: 98px;
            height: 146px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin: -50px 0 0 -50px;
        }
        .small img{
            width: 100%;
            height: 100%;
            vertical-align: top;
            position: absolute;
            left: 50%;
            top: 50%;
            margin: -50px 0 0 -50px;
            transform-origin: center bottom;
            transition-duration: 3s;
        }
        .small:hover img:nth-child(1){
            transform: rotate(-60deg);
        }
        .small:hover img:nth-child(2){
            transform: rotate(-50deg);
        }
        .small:hover img:nth-child(3){
            transform: rotate(-40deg);
        }
        .small:hover img:nth-child(4){
            transform: rotate(-30deg);
        }
        .small:hover img:nth-child(5){
            transform: rotate(-20deg);
        }
        .small:hover img:nth-child(6){
            transform: rotate(-10deg);
        }
        .small:hover img:nth-child(7){
            transform: rotate(0deg);
        }
        .small:hover img:nth-child(8){
            transform: rotate(10deg);
        }
        .small:hover img:nth-child(9){
            transform: rotate(20deg);
        }
        .small:hover img:nth-child(10){
            transform: rotate(30deg);
        }
        .small:hover img:nth-child(11){
            transform: rotate(40deg);
        }
        .small:hover img:nth-child(12){
            transform: rotate(50deg);
        }
        .small:hover img:nth-child(13){
            transform: rotate(60deg);
        }
主体代码:
<div class="big">
        <div class="small">
            <img src="../IT-week4作业/images/c-1.png" alt="">
            <img src="../IT-week4作业/images/c-2.png" alt="">
            <img src="../IT-week4作业/images/c-3.png" alt="">
            <img src="../IT-week4作业/images/c-4.png" alt="">
            <img src="../IT-week4作业/images/c-5.png" alt="">
            <img src="../IT-week4作业/images/c-6.png" alt="">
            <img src="../IT-week4作业/images/c-7.png" alt="">
            <img src="../IT-week4作业/images/c-8.png" alt="">
            <img src="../IT-week4作业/images/c-9.png" alt="">
            <img src="../IT-week4作业/images/c-10.png" alt="">
            <img src="../IT-week4作业/images/c-11.png" alt="">
            <img src="../IT-week4作业/images/c-12.png" alt="">
            <img src="../IT-week4作业/images/c-13.png" alt="">
        </div>
    </div>
 
效果展示:

 

 

posted @   包歌  阅读(248)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示