为什么设置了初始旋转角度,放开鼠标后就不会倒着旋转回来?

来源:3-3 编程练习

慕丝1534093

2017-02-07 15:46:11

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>3-1作业</title>

    <style>

        div {

            font-size: 14px;

            font-weight: bold;

            line-height: 50px;

            position: fixed;

            top: 0;

            right: 0;

            bottom: 0;

            left: 0;

            width: 200px;

            height: 50px;

            margin: auto;

            cursor: pointer;

            text-align: center;

            background: #abcdef;

            /*-transform: rotate(360deg);*/

            -webkit-transition: all 1s ease-in-out 0.5s;

               -moz-transition: all 1s ease-in-out 0.5s;

                -ms-transition: all 1s ease-in-out 0.5s;

                 -o-transition: all 1s ease-in-out 0.5s;

                    transition: all 1s ease-in-out 0.5s;


             

           

        }

        div:hover{

            font-size: 28px;

            font-weight: bold;

            line-height: 100px;

            position: fixed;

            top: 0;

            right: 0;

            bottom: 0;

            left: 0;

            width: 400px;

            height: 100px;

            margin: auto;

            cursor: pointer;

            text-align: center;

            background: #abcdef;

            transform: rotate(360deg);

            -webkit-transition: all 1s ease-in-out 0.5s;

               -moz-transition: all 1s ease-in-out 0.5s;

                -ms-transition: all 1s ease-in-out 0.5s;

                 -o-transition: all 1s ease-in-out 0.5s;

                    transition: all 1s ease-in-out 0.5s;}

        

       

    </style>

</head>

<body>

    <div>www.imooc.com</div>

</body>

</html>


写回答

1回答

小于飞飞

2017-02-07

测试可以实现所说效果,初始角度最好设置transform: rotate(0deg),希望对你有帮助,祝学习愉快,欢迎采纳。

0

0 学习 · 5760 问题

查看课程