123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <!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>
- ul{
- margin:0;
- padding: 0;
- }
- .box{
- width: 402px;
- height: 402px;
- border:1px dashed #000;
- margin:100px auto;
- }
- .clock{
- width: 400px;
- height: 400px;
- border:1px solid #000;
- border-radius: 50%;
- position: relative;
- }
- .clock li{
- list-style: none;
- width: 4px;
- height: 8px;
- background-color: #000;
- position: absolute;
- left: 50%;
- top: 0;
- transform-origin: 0 200px;
- }
- /* .clock li:nth-child(1){
- transform: rotate(0deg);
- }
- .clock li:nth-child(2){
- transform: rotate(6deg);
- }
- .clock li:nth-child(3){
- transform: rotate(12deg);
- } */
- .clock li:nth-child(5n+1){
- height: 16px;
- }
- </style>
- </head>
- <body>
- <div class="box">
- <div class="clock">
- <ul>
-
- </ul>
- </div>
- </div>
- <script>
- let oUl = document.getElementsByTagName("ul")[0];
- for(let i = 0;i<60;i++){
- let oLi = document.createElement("li");
- oLi.style.transform = `rotate(${i*6}deg)`;
- oUl.appendChild(oLi);
- }
- </script>
- </body>
- </html>
|