Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <!-- ====================================================================== CSS - Place this in your <head> or in an external stylesheet. ====================================================================== --> <style> :root { --ceh-padding: 4rem 1.5rem; --ceh-bg: radial-gradient(circle, #fefce8, #fef9c3); --ceh-text-color: #713f12; --ceh-headline-color: #854d0e; --ceh-price-color: #a16207; --ceh-strikethrough-color: #92400e; --ceh-accent-bg: #fbbf24; --ceh-cta-bg: #dc2626; --ceh-cta-hover-bg: #b91c1c; --ceh-cta-text-color: #ffffff; --ceh-max-width: 800px; } .call-to-enroll-hero { box-sizing: border-box; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; background-color: var(--ceh-bg-color); background-image: var(--ceh-bg); padding: var(--ceh-padding); width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; } .call-to-enroll-hero * { box-sizing: border-box; } .ceh-content { max-width: var(--ceh-max-width); } .ceh-content .title { color: var(--ceh-headline-color); font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.2; margin: 0 0 1rem; } .ceh-content .subtitle { color: var(--ceh-text-color); line-height: 1.6; margin: 0 auto 2rem; max-width: 650px; } .ceh-offer-box { background-color: #fef9c3; border: 2px dashed var(--ceh-accent-bg); border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; } .ceh-offer-box .offer-title { font-size: 1.2rem; font-weight: 700; color: var(--ceh-headline-color); margin: 0 0 0.5rem; } .ceh-offer-box .offer-countdown { font-size: 1.1rem; font-weight: 500; color: var(--ceh-text-color); } .ceh-price-wrapper { margin-bottom: 1.5rem; display: flex; justify-content: center; align-items: baseline; gap: 0.75rem; } .ceh-price-wrapper .current-price { font-size: clamp(2.5rem, 6vw, 3.5rem); font-weight: 800; color: var(--ceh-price-color); } .ceh-price-wrapper .original-price { font-size: 1.5rem; text-decoration: line-through; color: var(--ceh-strikethrough-color); opacity: 0.8; } .ceh-content .cta-button { display: inline-block; background-color: var(--ceh-cta-bg); color: var(--ceh-cta-text-color); padding: 1.25rem 3rem; border-radius: 8px; font-size: 1.25rem; font-weight: 700; text-decoration: none; transition: background-color 0.3s, transform 0.3s; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); } .ceh-content .cta-button:hover { background-color: var(--ceh-cta-hover-bg); transform: translateY(-2px); } </style> <!-- ====================================================================== HTML - Place this in your <body> where you want the component to appear. ====================================================================== --> <section class="call-to-enroll-hero"> <div class="ceh-content"> <h1 class="title">Unlock Your Creative Potential</h1> <p class="subtitle">Join our flagship course and learn the entire creative workflow from idea to final product.</p> <div class="ceh-offer-box"> <h2 class="offer-title">Early Bird Offer Ends Soon!</h2> <div id="offer-countdown" class="offer-countdown"> <!-- Countdown will be injected here --> </div> </div> <div class="ceh-price-wrapper"> <span class="current-price">$199</span> <span class="original-price">$299</span> </div> <a href="#" role="button" class="cta-button">Enroll Now & Save $100</a> </div> </section> <!-- ====================================================================== JavaScript - Place this right before your closing </body> tag. ====================================================================== --> <script> (function() { // --- IMPORTANT: Set the offer's expiration date here --- const offerEndDate = new Date("Dec 25, 2050 23:59:59").getTime(); const countdownElement = document.getElementById('offer-countdown'); if (!countdownElement) return; const interval = setInterval(() => { const now = new Date().getTime(); const distance = offerEndDate - now; if (distance < 0) { clearInterval(interval); countdownElement.textContent = "Offer Expired"; // Optionally, hide the price or change CTA text const priceWrapper = document.querySelector('.ceh-price-wrapper'); if(priceWrapper) priceWrapper.style.display = 'none'; return; } const days = Math.floor(distance / (1000 * 60 * 60 * 24)); const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); const seconds = Math.floor((distance % (1000 * 60)) / 1000); countdownElement.textContent = `${days}d : ${hours}h : ${minutes}m : ${seconds}s`; }, 1000); })(); </script>