This site uses third-party cookies, learn more or accept
dark light

CSS powered digital clock

Written by Max Pelic on
Update: the Jelly URL link shortener is live, be one of the first people to check it out!
For a limited time, get an exclusive discount by using the coupon code WEBSITE5OFF when you sign up for a free trial.

Today I made a clock using mostly CSS, with JavaScript powering it by updating the time.

I mainly used the nth-child CSS selector to turn lights on and off depending on the class of the parent div. You can view the full code on the codepen

Share this article:

Previous Article: Websockets and stuff

Next Article: Create 3D text with HTML, CSS, and JavaScript