Pen Settings

HTML

CSS

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

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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

Behavior

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <svg id="route" xmlns="http://www.w3.org/2000/svg" version="1.1" width="294" height="7293" viewBox="0 0 294.152 7293.492">
  <path id="path" fill="none" stroke="#D1232A" stroke-width="3" stroke-linecap="round" d="M157.656 7.212c0 0 100.344 178.906 100.344 321.913 0 271.418-220.792 286.061-220.792 407.951 0 121.889 240.638 175.278 240.638 249.546 0 57.827-52.157 57.26-55.559 127.03 -3.892 79.807 13.039 89.348 12.094 158.324 -0.944 68.977-77.071 136.497-115.275 179.528 -36.022 40.573-93.084 86.74-108.851 132.131 -13.381 38.524-19.24 132.253 67.276 164.471 86.516 32.217 178.575 58.708 207.387 133.319 28.812 74.611-41.038 146.05-92.111 183.308 -51.074 37.257-164.657 113.385-145.163 169.133 19.493 55.748 150.832 34.69 150.832 134.983s49.134 71.002 49.134 135.254 -36.851 200.126-36.851 247.37c0 47.243 50.41 99.401 50.41 172.157 0 72.756-45.686 154.016-45.686 235.275 0 114.331 22.678 205.04 23.622 280.63 1.469 117.537-190.866 112.442-190.866 222.048 0.945 113.385 182.567 178.233 187.958 295.748 13.138 286.299-153.376 635.527-186.667 782.361 -22.621 99.773-19.622 232.261 101.765 229.205 45.046-1.134 78.928-36.449 81.196-76.231 2.034-35.705-34.017-76.437-89.575-66.8 -59.712 10.357-91.345 60.498-106.016 136.087 -7.235 37.278-11.828 98.358-12.739 160.63 -2.394 163.629 76.938 201.007 105.149 220.85 14.682 10.326 106.274 49.377 103.748 94.15 -3.969 70.318-200.126 101.541-196.725 159.904 3.402 58.363 73.126 72.615 65.764 149.072 -7.37 76.535-80.933 101.479-80.933 180.85 0 121.324 78.098 200.126 71.295 283.465 -6.422 78.672-56.126 159.184-38.551 227.904 21.565 84.326 197.38 62.931 192.756 153.072 -3.386 65.994-171.22 82.799-212.599 141.732 -37.417 53.291-1.928 159.781 22.678 235.275 24.944 76.535 89.368 238.621 111.541 297.914"/>
</svg>
              
            
!

CSS

              
                #route {
  margin-top: 200px;
}
              
            
!

JS

              
                $(document).ready(function(){

  $(window).scroll(function() {
    drawLine( $('#route'),
              document.getElementById('path') );
  });
  
  // init the line length
    drawLine( $('#route'),
              document.getElementById('path') );

  //draw the line
  function drawLine(container, line){
    
    var pathLength = line.getTotalLength(),
        maxScrollTop = $(document).height() - $(window).height(),
        percentDone = $(window).scrollTop() / maxScrollTop,
        length = percentDone * pathLength;
    line.style.strokeDasharray = [ length ,pathLength].join(' ');
  }
  
});

              
            
!
999px
If you want to flex your skills and go off the grid, try coding a layout with float.

Console