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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <head>
  <title>Displaying Times and Dates</title>
  <link <link href="https://fonts.googleapis.com/css?family=Concert+One" rel="stylesheet"><!-- concert one font-->
</head>
<body>
  <div id="wrapper">
    <div id="redBox">
            
          
              <h1><div>Current Date and Time</div></h1>
                <div id="whiteBox">
               <script type="text/javascript">
 now = new Date ();
  localtime = now.toString();//sends the current time to the local time variable
  utctime = now.toGMTString();//sends the UTC time to the utc time variable
  //document.write("<p><strong>Local time:</strong>" + localtime + "</p>");writes up "local time" on the page
  //document.write("<p><strong>UTC time:</strong> " + utctime + "</p>" )writes up "utc time" on the page
  hours = now.getHours ();//goes and gets the hours for the clock
  mins = now.getMinutes ();//goes and gets the minutes for the clock
  secs = now.getSeconds ();//goes and gets the seconds for the clock
  milsecs = now.getMilliseconds ();//goes and gets the milliseconds for the clock
  document.write("<h2 id=freeflow>");//puts the clock time in bold
  
  document.write(hours + ":" + mins + ":" + secs + ":" + milsecs);//puts all the variables for the clock in a line

  document.write("</h2>")//closes the boldening
   
              </script><!--closes script-->
  <!--whiteBox-->
  </div><!--wrapper-->
    </div>
  </div>
  
</body>
            
          
!
            
              h2, h1{
  font-family: 'Concert One', cursive;
  z-index:2;
    text-align: center;
                }
 
#whiteBox{
  background-color: white;
  width: 400px;
  height: 70px;
  position: relative;
  margin-top: 0px;
    margin-left: 200px;
  z-index:1;
  border-style:solid;
  border-color:black
  
}  
 


h2 {
   font-size: 50px;
  top: -40px;
 
  }

#freeflow{
   position: relative;

  }

h1 div{
   position: relative;
  top: 10px
 
}

h1 {
  
   font-size: 50px;
  white-space: nowrap;
  
}
  #redBox{
    padding-top: 0px;
  margin-top:50px;
  width: 800px;
    height: 300px;
     background-color: red;
    position: absolute;
    left:0px;
      right:0px;
      z-index:0;
    box-shadow: 14px 10px 5px 0px rgba(0,0,0,0.75);
    border-style: solid;
    border-color: black;
    
    
}
#wrapper{
  margin: auto;
  width: 800px;
  height: 300px;
  position: relative;
  
 }
            
          
!
999px
Loading ..................

Console