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

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>
相关推荐
vim怎么退出44 分钟前
一次线上样式问题复盘:当你钻进 CSS 牛角尖时,问题可能根本不在 CSS
前端·css
yyf198905251 小时前
CSS相关中文书籍
css
禾叙_2 小时前
【NIO】ByteBuffer
前端·html·nio
triumph_passion3 小时前
Tailwind CSS v4 深度指南:目录架构与主题系统
前端·css
JAVA+C语言4 小时前
CSS 继承:核心概念 + 实用解析
前端·css
OpenTiny社区5 小时前
【博文精读】Chrome CSS 2025年回顾
前端·css
指尖跳动的光5 小时前
web网页如何禁止别人移除水印
前端·javascript·css
a17798877126 小时前
print.js打印
前端·javascript·html
3824278277 小时前
python:selenium,CSS位置偏移反爬案例
css·python·selenium
她说彩礼65万7 小时前
CSS 相对定位与绝对定位
前端·css