Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h1>Countdown Clock</h1>
<div id="clockdiv">
  <span id="clock"></span>


	text-align: center;
	background: #00ECB9;
  font-family: sans-serif;
  font-weight: 100;

  color: #396;
  font-weight: 100;
  font-size: 40px;
  margin: 40px 0px 20px;

	font-family: sans-serif;
	color: #fff;
	display: inline-block;
	text-align: center;
	font-size: 30px;
	padding: 10px;
	border-radius: 3px;
	background: #00BF96;

#clockdiv > span{
	padding: 15px;
	border-radius: 3px;
	background: #00816A;
	display: inline-block;



                (function() {
  // set our end time
  const endTime = new Date().getTime() + 10*24*60*60*1000;

  // store clock div to avoid repeatedly querying the DOM
  const clock = document.getElementById('clock');
  // calculate remaining time from now until deadline
  function getRemainingTime(deadline) {
    const currentTime = new Date().getTime();
    return deadline - currentTime;
  // pad value with zero
  function pad(value) {
    return ('0' + Math.floor(value)).slice(-2);

  // show time repeatedly
  function showTime() {
    const remainingTime = getRemainingTime(endTime);
    const seconds = pad((remainingTime / 1000) % 60);
    const minutes = pad((remainingTime / (60 * 1000)) % 60);
    const hours = pad((remainingTime / (60 * 60 * 1000)) % 24);
    const days = pad(remainingTime / (24 * 60 * 60 * 1000));

    clock.innerHTML = `${days}:${hours}:${minutes}:${seconds}`;

    // ensure clock only updates if a second or more is remaining
    if (remainingTime >= 1000) {
  // kick it all off