cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              @import url('https://fonts.googleapis.com/css?family=Roboto+Mono:100');

* {
  margin: 0;
  height: 100%;
  background: #1f8d9b; /* Old browsers */
  background: -moz-linear-gradient(45deg, #1f8d9b 0%, #48877a 100%); /* FF3.6-15 */
  background: -webkit-linear-gradient(45deg, #1f8d9b 0%,#48877a 100%); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(45deg, #1f8d9b 0%,#48877a 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  overflow: hidden;
}

#clock {
  width: 350px;
  height: 205px;
  padding-top: 145px;
  border: 1px solid whitesmoke;
  border-radius: 100%;
  color: whitesmoke;
  font-family: 'Roboto Mono', monospace;
  font-weight: 100;
  font-size: 3em;
  background: #e27f61; /* Old browsers */
  background: -moz-linear-gradient(-45deg, #e27f61 0%, #d67a48 100%); /* FF3.6-15 */
  background: -webkit-linear-gradient(-45deg, #e27f61 0%,#d67a48 100%); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(135deg, #e27f61 0%,#d67a48 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  position: absolute;
  left: 50vw;
  top: 50vh;
  transform: translate(-50%, -50%);
  text-align: center;
}
            
          
!
            
              window.onload = function renderTime() {
    	var currentTime = new Date();
    	var diem = 'AM';
    	var h = currentTime.getHours();
    	var m = currentTime.getMinutes();
    	var s = currentTime.getSeconds();

    	if (h == 0) {
    		h = 12;
    	} else if (h > 12) {
    		h = h - 12;
    		diem = "PM";
    	}

    	if (m < 10) {
    		m = "0" + m;
    	}
    	if (s < 10) {
    		s = "0" + s;
    	}

    	var myClock = document.getElementById('clock');
    	myClock.textContent = h + ':' + m + ':' + s + ' ' + diem;
    	myClock.innerText = h + ':' + m + ':' + s + ' ' + diem;
    	
        setTimeout(renderTime, 1000);
    }
	
    renderTime();
            
          
!
999px
Loading ..................

Console