css3之rotate的折扇的制作

css3之rotate的折扇的制作

在这里插入图片描述
代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding:0;}
        ul,li{
            list-style: none;
        }
        ul{
            width: 600px;
            height: 230px;
            border-bottom: 2px solid #000;
            margin:100px auto;
            /* background: #ccc; */
            position: relative;
        }
        li{
            width: 60px;
            height: 200px;
            box-shadow: 3px 3px 5px #333;
            position: absolute;
            left: 40%;
            transform-origin: 50% bottom;
            transition: 1s;
            text-align: center;
        }
        li:nth-child(1){
            background: red;
            z-index: 1000;
        }
        ul:hover li:nth-child(2){
            background: orange;
            transform: rotate(15deg);
        }
        ul:hover li:nth-child(3){
            background: yellow;
            transform: rotate(30deg);
        }
        ul:hover li:nth-child(4){
            background: green;
            transform: rotate(45deg);
        }
        ul:hover li:nth-child(5){
            background:turquoise;
            transform: rotate(60deg);
        }
        ul:hover li:nth-child(6){
            background: blue;
            transform: rotate(75deg);
        }
        ul:hover li:nth-child(7){
            background:violet;
            transform: rotate(90deg);
        }
        ul:hover li:nth-last-child(1){
            background: orange;
            transform: rotate(-15deg);
        }
        ul:hover li:nth-last-child(2){
            background: yellow;
            transform: rotate(-30deg);
        } ul:hover li:nth-last-child(3){
            background: green;
            transform: rotate(-45deg);
        }
        ul:hover li:nth-last-child(4){
            background: cyan;
            transform: rotate(-60deg);
        }
        ul:hover li:nth-last-child(5){
            background: blue;
            transform: rotate(-75deg);
        }
        ul:hover li:nth-last-child(6){
            background: purple;
            transform: rotate(-90deg);
        }
    </style>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>7</li>
        <li>6</li>
        <li>5</li>
        <li>4</li>
        <li>3</li>
        <li>2</li>
    </ul>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值