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.


  %span.title Normal
  %span.title 1/2 Speed Parallax
  %span.title 1/4 Speed Parallax
  %span.title Fixed Position
  Scrolling Background-Image Parallax


                @import url(;

background-image: linear-gradient(#9b59b6, #8E44AD 500px);
  font-family: "Bowlby One SC", sans-serif;
  color: #333;
height: 3000px;
width: 20%;
margin: 2.5%;
float: left;
background: white;
  background-image: linear-gradient(#ECF0F1 50%, #bdc3c7 50%);
  background-size: 50px 50px;
  font-size: 20px;
  box-sizing: border-box;
  text-align: center;
  font-weight: bold;
  position: relative;

  background-attachment: fixed;
  background-position: 0 26px;
h1 {
  position: fixed;
  bottom: 0px;
  text-align: center;
  background: #F1C40F;
  padding: .5em 1em;
  box-sizing: border-box;
span { 
  display: block;
  position: fixed;
  width: 20%;
  box-sizing: border-box;
  padding: 3px 10px;


                // The function
var background_image_parallax = function($object, multiplier){
  multiplier = typeof multiplier !== 'undefined' ? multiplier : 0.5;
	multiplier = 1 - multiplier;
  var $doc = $(document);
  $object.css({"background-attatchment" : "fixed"});
	  var from_top = $doc.scrollTop(),
	      bg_css = '0px ' +(multiplier * from_top) + 'px';
	  $object.css({"background-position" : bg_css });

//Just pass the jQuery object

//optional second value for speed
background_image_parallax($(".box3"), 0.25);