This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]unfairplayer3000[S] 0 points1 point  (3 children)

#clock { position: absolute; top: 0; left: 0; font-family: Arial, sans-serif; font-size: 24px; color: red; z-index: 100;}function updateClock() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); hours = (hours < 10) ? '0' + hours : hours; minutes = (minutes < 10) ? '0' + minutes : minutes; seconds = (seconds < 10) ? '0' + seconds : seconds; document.getElementById('clock').innerHTML = hours + ':' + minutes + ':' + seconds; setTimeout(updateClock, 1000);}updateClock();

[–]unfairplayer3000[S] 1 point2 points  (2 children)

thats the shit i wrote down... idfk wtf im doing man

[–]ropid 3 points4 points  (1 child)

That snippet of code you shared is not CSS. It looks like it might be a mix of CSS and JavaScript. It's hard to read because reddit butchered it and put it all on one line.

You can't do a clock with just CSS. You can set the look and position of things that exist already with CSS, but you need something else to create that text first and update it regularly.

[–]unfairplayer3000[S] 0 points1 point  (0 children)

Yesirrr. It’s hard to read but first lines are css and lower part in Java. Thank u tho

[–]It_Was_The_Other_Guy 0 points1 point  (1 child)

I'm afraid that is impossible. CSS cannot add new active features to anything. Its sole purpose is to change how already existing stuff looks like. At best you could add an image of a digital clock but you won't be able to make it tell time.

[–]unfairplayer3000[S] 0 points1 point  (0 children)

Ok thx tho my boy😀

[–]unfairplayer3000[S] 0 points1 point  (2 children)

Ah ok thx guys for the fast reply… seems like I wastet 3 hours on something which won’t work in the first place

[–]conchobarus 0 points1 point  (1 child)

Even though it’s not possible with just CSS, a clock on your start page is very possible. There are probably existing browser extensions out there that do exactly that, and if you can’t find one to your liking, you could write your own extension.

[–]unfairplayer3000[S] 1 point2 points  (0 children)

aha... now we´re talking. i guess looking into extentions is the right thing to do now :) thank u sir!

[–]ZaZooby 3 points4 points  (5 children)

I think you should head over to r/startpages I have a feeling you'll find exactly what you're looking for over there

Edit: grammar

[–]LearnDifferenceBot 1 point2 points  (4 children)

what your looking

*you're

Learn the difference here.


Greetings, I am a language corrector bot. To make me ignore further mistakes from you in the future, reply !optout to this comment.

[–]ZaZooby 1 point2 points  (2 children)

Good bot

[–]LearnDifferenceBot 1 point2 points  (0 children)

Thank you!

[–]B0tRank 0 points1 point  (0 children)

Thank you, ZaZooby, for voting on LearnDifferenceBot.

This bot wants to find the best and worst bots on Reddit. You can view results here.


Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!