鼠标移入盒子多角度有规律四散 (孔雀开屏)

css 复制代码
    <style>
        body{
            background-color: #F6F6F6;
        }
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style: none;
        }

        #box{
            width: 200px;
            height: 300px; 
            margin: 200px auto;
            
        }

        #box ul{
             position: relative;
        }

        #box ul li{
            width: 200px;
            height: 300px;
            background-color: cyan;
            position: absolute;
            left: 0;
            top: 0;
            font-size: 30px;
            text-align: center;
            line-height: 300px;
            transition: all linear 1s;
            /* 修改动画过渡中心点 */
            transform-origin: bottom center; 
            background: url(./true.jpg) no-repeat;
            background-size: 100% 100%;
        }

        #box:hover ul li:nth-child(1){
            transform: rotate(-80deg) translate(0,-400px);
        }

        #box:hover ul li:nth-child(2){
            transform: rotate(-30deg) translate(0,-400px);
        }

        #box:hover ul li:nth-child(3){
            transform: rotate(20deg) translate(0,-400px);
        }

        #box:hover ul li:nth-child(4){
            transform: rotate(70deg) translate(0,-400px);
        }

        #box:hover ul li:nth-child(5){
            transform: rotate(120deg) translate(0,-400px);
        }

        #box:hover ul li:nth-child(6){
            transform: rotate(70deg) translate(0,-400px);
        }

    </style>
html 复制代码
<body>
    <div id="box">
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>
相关推荐
q567315231 小时前
Koa+Puppeteer爬虫教程页面设计
javascript·css·爬虫
灵犀学长1 小时前
解锁HTML5页面生命周期API:前端开发的新视角
前端·html·html5
柚子81610 小时前
scroll-marker轮播组件不再难
前端·css
兴趣使然_11 小时前
【笔记】使用 html 创建网址快捷方式
笔记·html·js
凌辰揽月13 小时前
7月10号总结 (1)
前端·css·css3
天天扭码13 小时前
很全面的前端面试——CSS篇(上)
前端·css·面试
sunbyte13 小时前
50天50个小项目 (Vue3 + Tailwindcss V4) ✨ | DoubleVerticalSlider(双垂直滑块)
前端·javascript·css·vue.js·vue
Eighteen Z14 小时前
CSS揭秘:10.平行四边形
前端·css·css3
嘉琪00116 小时前
封装一个有最小化的dialog组件
前端·javascript·css
Zachery Pole16 小时前
BootStrap
前端·bootstrap·html