I want to create the following resultenter image description here
It is a cowntdown that I want to be in my html code.I have created the timer with javascript and it works fine but I cannot make it appear as I want in my html.I want it to appear exactly like the picture.
Here is my code
my html
<div class="container">
<hr class="new4">
<p class="countdown text-center">Μέχρι το δορυφορικό συμπόσιο απομένουν</p>
<p id="timer" class="timer text-center"></p>
<hr class="new4">
</div>
and my javascript
// Set the date we're counting down to
var countDownDate = new Date("Sep 19, 2020 16:30:00").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
document.getElementById("timer").innerHTML = days + " " + hours + " "
+ minutes + " " + seconds + " ";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("timer").innerHTML = "Συμβαίνει Τώρα";
}
}, 1000);
and my css
hr.new4 {
border: 1px solid white;
}
.timer{
font-size: 117px;
color:white;
}
Here is how it looks for me.enter image description here
I can not understand how to make the text apear exatly bellow the numbers and I cant understand how to add paddings between each of the elements that get return by the javascript document.getElementById() function. Please help me it is an emerjency I must have it until tomorow