Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use css3 to draw a circular dynamic clock

2026-02-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use css3 to draw a circular dynamic clock. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Use css3 to draw the code of a circular dynamic clock

Clock and watch

# wrap {width:200px;height:200px;border:2pxsolid#000;margin:100pxauto;border-radius:50%;position:relative;}

# wrapul {margin:0;padding:0;height:200px;position:relative;list-style:none;}

# wrapulli {width:2px;height:6px;background:#000;position:absolute;left:99px;top:0;-webkit-transform-origin:center100px;}

/ * # wrapulli:nth-of-type (1) {- webkit-transform:rotate (0);}

# wrapulli:nth-of-type (2) {- webkit-transform:rotate (6deg);}

# wrapulli:nth-of-type (3) {- webkit-transform:rotate (12deg);}

# wrapulli:nth-of-type (4) {- webkit-transform:rotate (18deg);}

# wrapulli:nth-of-type (5) {- webkit-transform:rotate (24deg);}

# wrapulli:nth-of-type (6) {- webkit-transform:rotate (30deg);}

# wrapulli:nth-of-type (7) {- webkit-transform:rotate (36deg);}

# wrapulli:nth-of-type (8) {- webkit-transform:rotate (42deg);} * /

# wrapulli:nth-of-type (5n+1) {height:12px;}

# hour {width:6px;height:45px;background:#000;position:absolute;left:97px;top:55px;-webkit-transform-origin:bottom;}

# min {width:4px;height:65px;background:#999;position:absolute;left:98px;top:35px;-webkit-transform-origin:bottom;}

# sec {width:2px;height:80px;background:red;position:absolute;left:99px;top:20px;-webkit-transform-origin:bottom;}

.icon {width:20px;height:20px;background:#000;border-radius:50%;position:absolute;left:90px;top:90px;}

VaroList=document.getElementById ("list"); / / get the scale

VaroCss=document.getElementById ("css")

VaroHour=document.getElementById ("hour"); / / get the hour hand

VaroMin=document.getElementById ("min"); / / get the minute hand

VaroSec=document.getElementById ("sec"); / / get the second hand

VaroLi= ""

VarsCss= ""

For (vari=0;i

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

  • How to realize the Wave effect with HTML

    This article mainly introduces how to achieve the wave effect of HTML, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand. 50.0%

    12
    Report