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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Basic Layout</title>
</head>

<body>

<div id="container">
<div id="header">
<h1>CSS3 Transitions</h1>
</div>
<div id="sideBar">
<ul>
<li><a href="#">Transitions</a></li>
<li><a href="#">Keyframes</a></li>
<li><a href="#">Transformations</a></li>
</ul>
</div>

<div id="content">
  <h2>Set what you want to animate with transition-property</h2>
  <p>With the transition-property you set the CSS properties to animate. These can be comma listed or you can use the value all to animate any properties that have changed from one CSS rule to another.</p>
  <p>The following will animate both the width and the padding properties.</p>
  <h2>transition-timing-function</h2>
  <p>If you have ever used a tool like Flash you will know that animations can be made more realistic by applying what are known as easing functions. Think of the way a train eases into and stops at a station. That would be an ease-out. The way a train starts from the station slowly and speeds up is known as an ease-in. By default CSS animations have an easefunction applied to them so they start slowly and also slow down towards the end. The best way to understand the ease functions is to see them in action.</p>
  <p>&nbsp;</p>
</div>

<div id="rightBar">
<div id="adMsg" class="startPoint">
<p>Fab offers and such like</p>
<div id="ball">

</div>
<p>Blah blah de blah</p>
</div>
</div>

<div id="footer">
&copy; The Footer
</div>

</div>
</body>
</html>

              
            
!

CSS

              
                body{
	font-family:Arial, Helvetica, sans-serif;
}
#container{
	width:960px;
	margin:auto;	
}
#header{
	height:120px;
}
#sideBar{
	width:180px;
	float:left;	
}
#sideBar ul{
	padding-left:0;
	list-style-type:none;
}
#sideBar ul li{
	padding-bottom:5px;
}
#sideBar ul li a{
	text-decoration:none;
	color:#666666;
	font-size:14px;
}
#rightBar{
	width:120px;
	height:600px;
	float:left;	
	border:1px solid #000000;
	margin-bottom:10px;
	overflow:hidden;
	position:relative;
}
#adMsg{
	position:absolute;	
	width:120px;
}
#ball{
	border-radius:120px;
	width:150px;
	height:150px;
	background-color:#F00;	
}
.moveMe{
	transition:top 1s;
	-webkit-transition:top 1s;
	top:450px;
}
.startPoint{
	transition:top 1s;
	-webkit-transition:top 1s;
	top:-50px;
}
#content{
	width:628px;
	float:left;	
	padding:0 15px;
}
#footer{
	clear:left;
	border-top:1px solid #CCC;	
	margin:5px 0;
	padding:15px;
	text-align:center;
}
              
            
!

JS

              
                document.getElementById('rightBar').addEventListener('mouseover', function(){
	document.getElementById('adMsg').setAttribute('class', 'moveMe');
});
document.getElementById('rightBar').addEventListener('mouseout', function(){
	document.getElementById('adMsg').setAttribute('class', 'startPoint');
});
              
            
!
999px

Console