Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div id="wrapper">


	<div id="forInput">
		<input type="text" name="input" value="" placeholder="Type here">
	</div>


	<div id="blueLine">
		
	
	
	
	</div>






</div>
              
            
!

CSS

              
                /** * html5doctor.com Reset Stylesheet v1.6.1 (http://html5doctor.com/html-5-reset-stylesheet/) * Richard Clark (http://richclarkdesign.com) * http://cssreset.com */html, body, div, span, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,abbr, address, cite, code,del, dfn, em, img, ins, kbd, q, samp,small, strong, sub, sup, var,b, i,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, figcaption, figure,footer, header, hgroup, menu, nav, section, summary,time, mark, audio, video {    margin:0;    padding:0;    border:0;    outline:0;    font-size:100%;    vertical-align:baseline;    background:transparent;}body {    line-height:1;}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {    display:block;}nav ul {    list-style:none;}blockquote, q {    quotes:none;}blockquote:before, blockquote:after,q:before, q:after {    content:'';    content:none;}a {    margin:0;    padding:0;    font-size:100%;    vertical-align:baseline;    background:transparent;}/* change colours to suit your needs */ins {    background-color:#ff9;    color:#000;    text-decoration:none;}/* change colours to suit your needs */mark {    background-color:#ff9;    color:#000;    font-style:italic;    font-weight:bold;}del {    text-decoration: line-through;}abbr[title], dfn[title] {    border-bottom:1px dotted;    cursor:help;}table {    border-collapse:collapse;    border-spacing:0;}/* change border colour to suit your needs */hr {    display:block;    height:1px;    border:0;    border-top:1px solid #cccccc;    margin:1em 0;    padding:0;}input, select {    vertical-align:middle;}
body {
	color: #fff;
}

input {
	padding: 0.7em;
	width: 30%;
	margin: 10% 35% 0% 35%;
	font-size: 3em;
}

#blueLine {
	display: block;
	background-color: #28c;
	width: 100%;
	height: 3px;
	margin-top: 15%;
}

.redCircle {
	background-color: #c31;
	display: block;
	position: absolute;
	margin: -1.3em 0em 0em 0em;
	margin-left: -20%;
	width: 3em;
	height: 3em;
	
    border-radius:50%;
    -moz-border-radius:50%;
    -webkit-border-radius:50%;
    -khtml-border-radius: 50%;
 	
 	 animation-duration: 6s;
 	 animation-name: slideAcross;
 
 	 -webkit-animation: slideAcross 12s linear;

	opacity: 0.8;
}


.inner {
	margin: auto;
	font-size: 1.4em;
	 text-align: center;
	line-height: 2.3em;
	opacity: 1;
}



@-webkit-keyframes slideAcross {
  from {
    margin-left: 99%;
  }

  to {
    margin-left: -30%;
  }
}



@keyframes slideAcross {
  from {
    margin-left: 99%;
  }

  to {
    margin-left: -20%;
  }
}


              
            
!

JS

              
                	//make first part of the space inside the red circle html
	var htmlA = "<p class=\"inner\">";
	
	//make second part
	var htmlB = "</p>";
	
	//make placeholder for completed html
	var newHtml = "";

	//reference a function
	window.onkeydown = keydown;

	


		//create function for keydown
		function keydown() {
        
          //build my new element
				var newDiv = document.createElement('div');

				var blueLine = document.querySelector('#blueLine');

				newDiv.className = 'redCircle';

				blueLine.appendChild(newDiv);


				//concatenate new html with the new character
				newHtml = htmlA + String.fromCharCode(event.keyCode) + htmlB;
	
				//add my new html to innerHTML of newDiv
				newDiv.innerHTML += newHtml;
	
		}
              
            
!
999px

Console