{"id":344147,"date":"2021-07-16T07:43:01","date_gmt":"2021-07-16T14:43:01","guid":{"rendered":"https:\/\/css-tricks.com\/?p=344147"},"modified":"2021-07-16T07:43:04","modified_gmt":"2021-07-16T14:43:04","slug":"of-course-we-can-make-a-css-only-clock-that-tells-the-current-time","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/of-course-we-can-make-a-css-only-clock-that-tells-the-current-time\/","title":{"rendered":"Of Course We Can Make a CSS-Only Clock That Tells the Current Time!"},"content":{"rendered":"\n

Let\u2019s build a fully functioning and settable \u201canalog\u201d clock with CSS custom properties<\/a> and the calc()<\/code> function<\/a>. Then we\u2019ll convert it into a \u201cdigital\u201d clock as well. All this with no JavaScript!<\/p>\n\n\n\n\n\n\n\n

Here\u2019s a quick look at the clocks we\u2019ll make:<\/p>\n\n\n\n

\n