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.


                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam aut odit libero commodi, reiciendis iure magnam modi tempore. Repellendus, voluptas! Sunt magnam iusto, nam cum pariatur molestiae ipsam harum aperiam.</p>

<p data-height="537" data-theme-id="1" data-slug-hash="RNLdpz" data-default-tab="result" data-user="osublake" data-embed-version="2" data-pen-title="Sortable Grid Using GreenSock Draggable" class="codepen">See the Pen <a href="">Sortable Grid Using GreenSock Draggable</a> by Blake Bowen (<a href="">@osublake</a>) on <a href="">CodePen</a>.</p>
<script async src=""></script>

<p>Alias maxime, accusamus amet quos aliquid non obcaecati aliquam quidem quod cumque accusantium! In voluptates, similique nihil consequuntur sequi nobis eaque quam praesentium quasi, laboriosam, provident minus molestiae est inventore.</p>


                .cp_embed_wrapper {
  position: relative;
  margin: 0 0 1rem 0;
  &.dragging {
    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 4000;
  .cp_embed_iframe {
    display: block;
.win-size-grip {
   position: absolute;
   width: 16px;
   height: 16px;
   padding: 4px;
   bottom: 0;
   right: 0;
   z-index: 5000;
   cursor: nwse-resize;
   background: url( no-repeat;

body {
  max-width: 780px;
  padding: 10px;
  margin: 0 auto;
  font: 22px/1.5 sans-serif;


                // This is the callback from CodePen's embed script, ei.js
function __CodePenIFrameAddedToPage() {

function makeEmbedsResizeable() {
  // You don't have to set min and max, but it's kinda useful so that users don't drag them to a weird/bad size.
  var maxWidth = 1000; // calculated below
  var minWidth = 320;
  var minHeight = 150; 
  $(".cp_embed_wrapper").each(function() {
    var $wrapper = $(this);
    var $iframe = $wrapper.find("iframe");
    $wrapper.append("<div class='win-size-grip'></div>");
    var originalHeight = $iframe.outerHeight();
    $wrapper.css("height", originalHeight);
    // Can't set this in CSS, otherwise height measurement will be wrong
    $iframe.css("height", "100%");
      handleSelector: "> .win-size-grip",
      onDragStart: function (e, $el, opt) {
        maxWidth = window.outerWidth;
      onDragEnd: function (e, $el, opt) {
      onDrag: function (e, $el, newWidth, newHeight, opt) {
        if (newWidth > maxWidth) {
          newWidth = maxWidth;
        if (newWidth < minWidth) {
          newWidth = minWidth;
        if (newHeight < minHeight) {
          newHeight = minHeight;
        return false;