Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> CSS

CSS और JavaScript से कमिंग सून पेज कैसे बनाएं?


CSS और JavaScript से कमिंग सून पेज बनाने के लिए, कोड निम्नानुसार है -

उदाहरण

<!DOCTYPE html> <html> <style>    body {       height: 100vh;       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;       margin: 0;    }    .timer {       text-align: center;       font-size: 60px;       margin-top: 0px;       color: white;    }    .bgimg {       background-image: url("https://i.picsum.photos/id/829/800/800.jpg");       height: 100%;       background-position: center;       background-size: cover;       position: relative;       color: white;       font-size: 25px;    }    .middle {       position: absolute;       top: 50%;       left: 50%;       transform: translate(-50%, -50%);       text-align: center;    }    hr {       margin: auto;       width: 40%;    } </style> <body> <div class="bgimg"> <div class="middle"> <h1>COMING SOON</h1> <hr /> <h2 class="timer"></h2> </div> </div> <script>    var countDownDate = new Date("June 5, 2022 11:27:15").getTime();    var timeClear = setInterval(function() {       var now = new Date().getTime();       var timeLeft = countDownDate - now;       var days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));       var hours = Math.floor(          (timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)       );       var minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));       var seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);       document.querySelector(".timer").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";       if (timeLeft < 0) {          clearInterval(timeClear);          document.querySelector(".timer").innerHTML = "Timer Finished";       }    }, 1000); </script> </body> </html>

आउटपुट

उपरोक्त कोड निम्न आउटपुट उत्पन्न करेगा -

CSS और JavaScript से कमिंग सून पेज कैसे बनाएं?


  1. CSS और JavaScript से कोट्स स्लाइडशो कैसे बनाएं? CSS और JavaScript से कोट्स स्लाइडशो कैसे बनाएं?

    उदाहरण CSS और JavaScript से कोट स्लाइडशो बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "S

  1. CSS और JavaScript से लिस्ट ग्रिड व्यू कैसे बनाएं? CSS और JavaScript से लिस्ट ग्रिड व्यू कैसे बनाएं?

    उदाहरण लिस्ट ग्रिड व्यू बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <style>    * {       box-sizing: border-box;    }    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdan

  1. CSS और JavaScript से एक्सपैंडिंग ग्रिड कैसे बनाएं? CSS और JavaScript से एक्सपैंडिंग ग्रिड कैसे बनाएं?

    उदाहरण CSS और JavaScript से एक्सपैंडिंग ग्रिड बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       padding: 1%; &n