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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                <div class="container">
  <div class="one">1</div>
  <div class="three">3</div>
  <div class="five">5</div>
  <div class="draggable">
    <div class="two">2</div>
    <div class="four">4</div>
    <div class="six">6</div>
  </div>
</div>
              
            
!

CSS

              
                // This was a proof of concept
// You can see a more realized version at lynnandtonic.com

.container
  width: 300px
  height: 300px
  position: relative
  margin-top: 110px
  font-weight: bold
  
  .one,.three,.five
    width: 100%
    height: 33.33%
    position: absolute
  .one
    background-color: tomato
    bottom: 0
    z-index: 1
  .three
    background-color: coral
    top: 33.33%
    z-index: 3
  .five
    background-color: lightsalmon
    top: 0
    z-index: 5

.draggable
  width: 100%
  height: 100%
  position: absolute
  left: 100px
  top: -33.33%
  cursor: grab
  
  .two,.four,.six
    width: 100%
    height: 33.33%
    position: absolute
    text-align: right
  .two
    z-index: 2
    background-color: mediumturquoise
    bottom: 0
  .four
    z-index: 4 
    background-color: turquoise
    top: 33.33%
  .six
    z-index: 6
    background-color: paleturquoise
    top: 0
              
            
!

JS

              
                // external js: draggabilly.pkgd.js

var dissolve = new Draggabilly( '.draggable', {
  axis: 'y'
});

dissolve.positionDrag = function() {
  this.setLeftTop();
};
              
            
!
999px

Console