1. 程式人生 > >JS-tranform-位移-滾動效果

JS-tranform-位移-滾動效果

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
    <style>
        #scroll{
            width:100px;
            height:100px;
            border-radius:50%;
            background:red;
            border:6px solid yellow;
            text-align:center;
            line-height:100px;
            font-size:40px;
            color:#fff;
            font-weight:bold;
            /*過渡效果*/
            transition:all 3s;
        }

        #scroll:hover{
            transform:translate(500px) rotate(1080deg);
        }
    </style>
 </head>
 <body>
  <div id="scroll">滾</div>
 </body>
</html>