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

+ add another resource


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


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.


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.


                <link href=',700' rel='stylesheet' type='text/css'>

<article id="one" class="bg-img img1"></article>
<article id="two" class="bg-img img2"></article>
<article id="three" class="bg-img img3"></article>

<div id="output">


                @import "compass/css3";

body {
  background: #333333;
  font-family: 'Roboto', sans-serif;

.bg-img {
  float: left;
  width: 300px;
  height: 300px;
  margin: 5px;
  @include transition(opacity 3s ease-in-out);
  opacity: 0;
  background: #683B25 no-repeat center center;
  background-size: cover;
  //border: 4px solid transparent;
  position: relative;
  padding: 0;
  &.bg-loaded {
    opacity: 1;
.img1 {
  background-image: url('');
.img2 {
  background-image: url(;
.img3 {
  background-image: url(;

#output {
  color: #fff;
  font-size: 16px;
  margin: 4px;
  padding: 10px;
  float: left;
  width: 300px;
  clear: right;
  h1 {
    margin-top: 0;


 * BG Loaded
 * Copyright (c) 2014 Jonathan Catmull
 * Licensed under the MIT license.
 	$.fn.bgLoaded = function(custom) {

 		var self = this;

	// Default plugin settings
	var defaults = {
		afterLoaded : function(){

		// Merge default and user settings
		var settings = $.extend({}, defaults, custom);

		// Loop through element
			var $this = $(this),
				bgImgs = $this.css('background-image').split(', ');

			$.each( bgImgs, function(key, value){
				var img = value.replace(/^url\(["']?/, '').replace(/["']?\)$/, '');
				$('<img/>').attr('src', img).on('load', function() {
					$(this).remove(); // prevent memory leaks
					if ($'loaded-count') >= bgImgs.length) {$this);


// Example with different callback function
var startTime = new Date().getTime();
  afterLoaded : function(){
   $('#output').append(this.attr('id')+' took '+Math.round((new Date().getTime() - startTime))+'ms <br>');