I have added a countdown feature to my Laravel 5 application and I am trying to adjust the font weight of the text, but I am facing some difficulties. When I set the color to #fff, the font-weight works perfectly fine, but when I change the color, the font-weight seems to stop working.
Here are some images for comparison: https://i.sstatic.net/x4TjB.png https://i.sstatic.net/OLQwP.png
The code in my blade.php file looks like this:
<a style="color: #fff" href="">
<div id="countdown-component" style="display:inline;color:#EC1B33;font-weight:600;letter-spacing:2px;">
</div>
</a>
Here is the JS function responsible for generating the countdown:
<script>
// Set the date we're counting down to
var countDownDate = new Date("Feb 15, 2022 12:00: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);
// Display the result in the element with id="demo"
document.getElementById("countdown-component").innerHTML = days + " DAYS " + hours + " HOURS "
+ minutes + " MINUTES " + seconds + " SECONDS ";
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("countdown-component").innerHTML = "EXPIRED";
}
}, 1000);
</script>
Any assistance on this matter would be greatly appreciated. Thank you.