Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

Behavior

Auto Save

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Positioning</title>
	<link rel="stylesheet" href="style.css">
</head>
<body>
	<nav>
		<ul class="nav">
			<li>home</li>
			<li>about</li>
			<li>portfolio</li>
			<li>contact</li>
		</ul>
	</nav>
	<div class="wrapper">
		<div class="top">Top</div>
		<div class="middle">Middle</div>
		<div class="bottom">Bottom</div>
	</div>
	Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pulvinar venenatis dolor, ut iaculis libero dignissim quis. Curabitur molestie dapibus lorem mattis gravida. Proin blandit nisi ac arcu fermentum sollicitudin. Cras tempor quam eget odio vulputate sed rutrum justo lobortis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Morbi ultricies fermentum blandit. Vestibulum nisi ante, placerat id mattis a, bibendum malesuada augue.</p>

		<p>Phasellus tincidunt eros id nisl ultrices ornare. Nunc sem metus, bibendum nec aliquet in, luctus non libero. Duis posuere cursus accumsan. Cras vulputate sagittis mollis. Mauris diam est, malesuada ac tempus vel, molestie ut nunc. Maecenas bibendum, elit in lacinia lobortis, dolor erat dapibus mauris, non iaculis massa augue at turpis. Suspendisse et enim in libero condimentum venenatis. Nam eleifend, lacus quis dictum blandit, eros dui eleifend nunc, ac cursus justo mauris sed nunc. In hac habitasse platea dictumst. Etiam viverra lectus sed erat tincidunt a eleifend enim eleifend. Proin pharetra tempus magna mollis tincidunt. Etiam arcu arcu, rhoncus in vestibulum a, sollicitudin a massa. Proin vitae dui sem.</p>

		<p>Quisque vel neque neque. Mauris rutrum augue eget metus facilisis et laoreet tellus convallis. Vestibulum sapien risus, iaculis et blandit ac, consectetur eu elit. Nullam mattis congue tincidunt. Nam eu velit turpis, sit amet vestibulum tortor. Pellentesque dictum, eros et suscipit placerat, dolor nisi consequat odio, a dapibus urna felis nec diam. Suspendisse sem nisl, varius et facilisis vel, volutpat et purus. Praesent id metus ante, quis gravida erat. Mauris vel urna massa, at fermentum turpis. Nunc eleifend egestas nulla, vitae porta massa luctus tempor.</p>

		<p>Proin ornare dapibus lectus nec tincidunt. Mauris et turpis vitae lacus pulvinar interdum et ut lectus. Integer ut convallis est. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque egestas porta nisi ut imperdiet. Nulla et sem diam. Integer ornare, velit a interdum tempor, nunc dui sodales dui, eu rhoncus nisi augue consectetur nibh. Fusce sagittis est a mauris bibendum id congue lorem posuere. Fusce lacinia metus vitae mauris vestibulum non convallis quam sollicitudin.</p>

		<p>Cras sapien lectus, tincidunt in mattis vitae, cursus id ante. Donec porttitor sapien in est aliquet blandit. Aliquam tellus justo, facilisis eget pellentesque id, ultricies nec eros. Nullam neque neque, sollicitudin id consequat sed, feugiat feugiat quam. Aenean in lectus elit. Ut tristique, nulla malesuada lacinia vestibulum, purus tortor vestibulum quam, eu molestie eros tortor ac arcu. Suspendisse potenti. Nulla aliquam, sapien id adipiscing porttitor, eros dui fringilla nisi, et volutpat leo nisl sed metus. Sed dui est, placerat et mollis lobortis, vehicula eu magna. Ut a ante eget neque viverra vehicula nec vulputate eros. Etiam mi mi, vestibulum vitae sodales ac, tempor eget libero. Cras nisi dolor, commodo sed faucibus id, mattis in lectus. Sed ut augue eu nulla suscipit facilisis ac eu ipsum. Sed tincidunt luctus lobortis. Cras interdum lacinia mi, at porttitor lorem posuere qui.</p>

		<p>Phasellus tincidunt eros id nisl ultrices ornare. Nunc sem metus, bibendum nec aliquet in, luctus non libero. Duis posuere cursus accumsan. Cras vulputate sagittis mollis. Mauris diam est, malesuada ac tempus vel, molestie ut nunc. Maecenas bibendum, elit in lacinia lobortis, dolor erat dapibus mauris, non iaculis massa augue at turpis. Suspendisse et enim in libero condimentum venenatis. Nam eleifend, lacus quis dictum blandit, eros dui eleifend nunc, ac cursus justo mauris sed nunc. In hac habitasse platea dictumst. Etiam viverra lectus sed erat tincidunt a eleifend enim eleifend. Proin pharetra tempus magna mollis tincidunt. Etiam arcu arcu, rhoncus in vestibulum a, sollicitudin a massa. Proin vitae dui sem.</p>

		<p>Quisque vel neque neque. Mauris rutrum augue eget metus facilisis et laoreet tellus convallis. Vestibulum sapien risus, iaculis et blandit ac, consectetur eu elit. Nullam mattis congue tincidunt. Nam eu velit turpis, sit amet vestibulum tortor. Pellentesque dictum, eros et suscipit placerat, dolor nisi consequat odio, a dapibus urna felis nec diam. Suspendisse sem nisl, varius et facilisis vel, volutpat et purus. Praesent id metus ante, quis gravida erat. Mauris vel urna massa, at fermentum turpis. Nunc eleifend egestas nulla, vitae porta massa luctus tempor.</p>

		<p>Proin ornare dapibus lectus nec tincidunt. Mauris et turpis vitae lacus pulvinar interdum et ut lectus. Integer ut convallis est. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque egestas porta nisi ut imperdiet. Nulla et sem diam. Integer ornare, velit a interdum tempor, nunc dui sodales dui, eu rhoncus nisi augue consectetur nibh. Fusce sagittis est a mauris bibendum id congue lorem posuere. Fusce lacinia metus vitae mauris vestibulum non convallis quam sollicitudin.</p>
</body>
</html>
              
            
!

CSS

              
                
.nav {
	width: 100%;
	background: #fff;
	position: fixed;
	top: -0;
	color: #000;
	z-index: 30;
}

.nav li {
	display: inline-block;
	margin: 5px 45px;
}

body {
	margin: 70px 0 0;
	background: #E1E1DD;
	color: #FFF;
	font: normal 1.4em sans-serif;
}

.wrapper {
	box-sizing: border-box;
	margin: 0 auto;
	width: 80%;
	background: #FFF;
	position: relative;
}

.top {
	background: #FF6347;
}

.middle {
	background: #87CEEB;
	position: absolute;
	right: 0;
	bottom: 0;
}

.middle:after {
	position: absolute;
	bottom: 0;
	left:0;
	width: 50px;
	height:50px;
	background:#000;
	content:"";
}

.bottom {
	background: #20B2AA;
}

.fixed {
	position: fixed;
	top: 0;
	width: 100%;
	height: 60px;
	background-color: black;
}

.wrapper div {
	width: 150px;
	height: 150px;
	text-align: center;	
	line-height: 150px;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
}
              
            
!

JS

              
                
              
            
!
999px
How do you comfort a JavaScript bug? You console it!

Console