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.



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


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.


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 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


  <div class="title">
    <h2>Drag me</h2>
  <div class="content">
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam eget arcu ac risus aliquam tincidunt sed eu enim. Vivamus feugiat fringilla dolor ut vulputate. In nibh risus, tristique at orci tincidunt, luctus eleifend nisl. Morbi vehicula, risus eget tincidunt lobortis, sapien purus faucibus ligula, non facilisis nulla purus at metus. Proin vitae elementum lectus, vitae porta velit. Curabitur blandit pharetra ipsum, et dictum nibh dignissim id. Aliquam erat volutpat.</p>
    <p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis laoreet purus ligula, in interdum odio tincidunt sed. Nullam non elementum erat. Aliquam sollicitudin sem eget ligula pellentesque, a pretium est dapibus. Mauris pharetra nunc in enim porttitor, et venenatis velit rhoncus. Etiam ac leo sapien. Mauris et tempus metus. Pellentesque vitae mi ac urna porttitor gravida nec iaculis leo. Aliquam adipiscing est diam, non feugiat lorem iaculis id. Aenean euismod iaculis nibh, ac adipiscing ante molestie at. Nam quis orci varius sapien blandit consequat.</p>

<div class="attr">
  <h6>Photo by DAVID ILIFF. License: CC-BY-SA 3.0</h6>


                *, *:after, *:before {
  box-sizing: border-box;
* {
  position: relative;

html, body {
  margin: 0;
  padding: 0;

body {
  background: url('') 50% no-repeat fixed;
  background-size: cover;
  font: 14px/1.2 'Helvetica Neue', Helvetica, sans-serif;

h2 {
  font-size: 1.4em;
p {
  margin-bottom: 0.4em;

article {
  width: 300px;
  position: absolute;
  top: 40px;
  left: 40px;
  background: inherit;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  overflow: hidden;

  &:before {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: inherit;
    -webkit-filter: blur(10px) saturate(2);
  .title {
    padding: 8px;
    background: rgba(225,225,225,0.5);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    text-align: center;
  .content {
    padding: 8px;
    background: rgba(255,255,255,0.5);

.attr {
  position: fixed;
  right: 5px;
  bottom: 5px;
  font-size: 0.8em;
  color: white;


Keep the <main> thing the <main> thing.