80
rated 0 times
[
84]
[
4]
/ answers: 1 / hits: 25002
/ 7 Years ago, thu, june 8, 2017, 12:00:00
How can I have the time
variable's contents displayed as the content
property in my CSS?
JavaScript:
function clock(){
var d = new Date();
var hour = d.getHours();
var min = d.getMinutes();
var time = hour + : + min;
}
CSS:
.screen{
position: absolute;
height: 75%;
width: 75%;
background: #98E8EE;
top: 11.5%;
left: 12.5%;
}
.screen::after{
color: #F9F5F4;
font-size: 40px;
content: ;
font-family: Arial;
margin-left: 36.5px;
top: 20px;
position: relative
}
More From » css