I'm still getting the hang of CSS and JavaScript. I stumbled upon a cool countdown timer that I'd like to incorporate into my website, but I'm not quite sure how to place it where I envision it.
Check out the timer here
CSS:
html,body{margin:0px;padding:0px}
#cdt a img{border:0}
#cdt .demo{position:absolute;z-index:999;right:0;top:0}
#cdt #ie-fix{display:none}
#cdt .digit{background-image:url(https://d3qhtuwg866bv9.cloudfront.net/oc-sprite?bg_color=00000000&date_label=&encoding=png&font=Kelly+Slab&font_push_down=0.01&height=90&overlay_size=700%2C180&quality=0.95&renderer=v1&scale=1.124&shadow=1&shadow_blur=4&shadow_color=ffffff77&shadow_y=0&style=TemplateDigits01&text_align=center&title=&txt_color=ffffffFF&unit_labels=DAYS%2CHOURS%2CMINUTES%2CSECONDS&use_overlay=1&width=393);background-repeat:no-repeat;width:34px}
#cdt .digit-0{background-position:-315px -450px}
#cdt .digit-1{background-position:0px -405px}
#cdt .digit-2{background-position:-315px -360px}
#cdt .digit-3{background-position:0px -315px}
#cdt .digit-4{background-position:-315px -270px}
#cdt .digit-5{background-position:0px -225px}
#cdt .digit-6{background-position:-315px -180px}
#cdt .digit-7{background-position:0px -135px}
#cdt .digit-8{background-position:-315px -90px}
#cdt .digit-9{background-position:0px -45px}
#cdt .digit-x{width:17px;background-position:-730px -64px}
#cdt.widget-wrapper{width:393px;height:90px;position:relative;margin:auto}
#cdt .content-wrapper{width:100%;height:100%;background-position:0 -40px}
#cdt .spr{background-image:url(https://d29am0ph5s0t8u.cloudfront.net/production/cdt/widgets/sprites/image/1405744/oc-sprite.png?version=57509bf5-6)}@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5)
{#cdt .spr{background-image:url(https://d29am0ph5s0t8u.cloudfront.net/production/cdt/widgets/sprites/retina_image/1405744/oc-sprite.png?version=57509bf5-6);background-size:899px 202px}}
#cdt .counter-wrapper{width:374px;height:45.0px;margin-left:19px}
#cdt .counter-wrapper .counter-item{height:48px;float:left}
#cdt .counter-wrapper .counter-group{height:67px;float:left;position:relative;overflow:hidden}
#cdt .counter-group .unit-label{position:absolute;height:25px;width:67px;left:0;top:46px}
#cdt .days .unit-label{background-position:-393px -128px}
#cdt .hours .unit-label{background-position:-461px -128px}
#cdt .minutes .unit-label{background-position:-528px -128px}
#cdt .seconds .unit-label{background-position:-596px -128px}
#cdt .header{height:19px;width:100%}
HTML:
<div id="cdt" class='widget-wrapper'>
<div class='content-wrapper spr'>
<div class='header'>
</div>
<div class='counter-wrapper'>
<div class='days counter-group'>
<div class='counter-item'></div>
<div class='counter-item'></div>
<div class='counter-item'></div>
<div class='unit-label spr'>
</div>
</div>
<div class='counter-item'></div>
<div class='hours counter-group'>
<div class='counter-item'></div>
<div class='counter-item'></div>
<div class='unit-label spr'>
</div>
</div>
<div class='counter-item'></div>
<div class='minutes counter-group'>
<div class='counter-item'></div>
<div class='counter-item'></div>
<div class='unit-label spr'>
</div>
</div>
<div class='counter-item'></div>
<div class='seconds counter-group'>
<div class='counter-item'></div>
<div class='counter-item'></div>
<div class='unit-label spr'>
</div>
</div>
</div>
</div>
</div>
Javascript:
Too long to put here
In my website files, I've set up a count.css
file and a count.js
file with the necessary code. Now, I just need guidance on where in my website's index.html
file to include them so the counter will display correctly.
Appreciate the help!