Pen Settings



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


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.


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.


                <div id="texttop">
		<h1>True Cross-Fade Background Images</h1>
		<p>A repeating sequence of fullscreen background images, pushed all the way to the root element. Crossfading effect in Webkit-derived browsers (Chrome, Safari, Opera).</p>


                * { 
  box-sizing: border-box; 
html {
  margin: 0;
  background-size: cover;
  background: url("") no-repeat center center fixed;
  background-blend-mode: darken;
  // blend mode optional at this stage; will be used more in the next demo.
  transition: 3s;
body { margin: 0; }
div#texttop { 
	color: #fff;
	width: 30%;
	margin-top: 5%;
	margin-left: 5%;
	padding: 2rem;
	border: 4px double rgba(255,255,255,0.3);
	background: rgba(0,0,0,0.3);
	font-family: Oxygen, sans-serif;
h1 { 
  margin-top: 0; 
  text-align: center;
  font-weight: 100;
p { 
   line-height: 1.6; 
@media all and (max-width: 770px) {
	div#texttop { display: none; }


                var bgImageArray = ["lonely.jpg", "uluwatu.jpg", "carezza-lake.jpg", "batu-bolong-temple.jpg"],
base = "",
secs = 4;
    new Image().src = base + img; 
    // caches images, avoiding white flash between background replacements

function backgroundSequence() {
	var k = 0;
	for (i = 0; i < bgImageArray.length; i++) {
		setTimeout(function(){ = "url(" + base + bgImageArray[k] + ") no-repeat center center fixed"; ="cover";
		if ((k + 1) === bgImageArray.length) { setTimeout(function() { backgroundSequence() }, (secs * 1000))} else { k++; }			
		}, (secs * 1000) * i)