AhmadMashhoor Posted October 28, 2020 Share Posted October 28, 2020 This is the first post. I tried very hard to modify this HTML to give you this content. You can use it in (head or header) which is a countdown that can be manually edited to alert customers to purchase before the time expires I apologize for my bad english <!DOCTYPE html> <html> <head> <style> table, th, td { border: 0.2rem solid green; border-collapse: separate; center color: white; background: #b70e0e; } th, td { padding: 0.1rem; } th { text-align: center; color: white ; font-size:20px; } </style> </head> <body> <h2></h2> <table style="width:100%"> <tr> <html> <th>Discounts end on <meta name="viewport" content="width=device-width, initial-scale=1"> <style> p { text-align: center; font-size: 25px; margin-top: 0.1rem; color: white ; Height:2px; } </style> <p id="demo"></p> <script> // Set the date we're counting down to var countDownDate = new Date("Jan 5, 2021 15:37:25").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("demo").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("demo").innerHTML = "EXPIRED"; } }, 1000); </script> </table> </body> </html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now