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

              
                <body>
  <div class="codepen">
    <header class="pen">
      <div class="pen__details">
        <h1>Some Amazing Pen Name</h1>
        <p class="pen__author">Marco Kühbauch</p>
      </div>
      <button class="button button--dirty">☁️ Save</button>
      <button class="button">️️☁️ Save As Private</button>
      <button class="button">⚙ Settings</button>
      <button class="button">👀 Change View</button>
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/28831/profile/profile-80.jpg?1" alt="Wes Bos" height="44">
    </header>
    <section class="code">
      <div class="editor">
        <header class="editor__header">
          <button class="button button--small editor__settings">⚙</button>
          <h3 class="editor__heading">HTML</h3>
          <button class="button button--small editor__settings">⌄</button>
        </header>
        <div class="editor__code">
          <div class="editor__gutter">
            <span class="editor__number">1</span>
          </div>

          <textarea class="editor__input"><p>Oh Hey There!</p></textarea>
        </div>
      </div>
      <div class="editor">
        <header class="editor__header">
          <button class="button button--small editor__settings">⚙</button>
          <h3 class="editor__heading">CSS</h3>
          <button class="button button--small editor__settings">⌄</button>
        </header>
        <div class="editor__code">
          <div class="editor__gutter">
            <span class="editor__number">1</span>
            <span class="editor__number">2</span>
            <span class="editor__number">3</span>
          </div>

          <textarea class="editor__input">.codepen {
  is: cool;
}
          </textarea>
        </div>

      </div>
      <div class="editor">
        <header class="editor__header">
          <button class="button button--small editor__settings">⚙</button>
          <h3 class="editor__heading">JS</h3>
          <button class="button button--small editor__settings">⌄</button>
        </header>
        <div class="editor__code">
          <div class="editor__gutter">
            <span class="editor__number">1</span>
          </div>
          <textarea class="editor__input">const wes = 'coolest';</textarea>
        </div>

      </div>
    </section>
    <section class="preview">
      <iframe src="https://marcokuehbauch.com" frameborder="0"></iframe>
    </section>
    <footer class="settings">
      <button class="button button--small button--black">Console</button>
      <button class="button button--small button--black">Assets</button>
      <button class="button button--small button--black">⌘</button>
    </footer>
  </div>
</body>
              
            
!

CSS

              
                :root {
  --grey: #343436;
}

.codepen {
  color: white;
  display: grid;
  grid-template-rows: auto 1fr 1fr auto;
  height: 100vh;
}

.codepen>* {
  border: 1px solid black;
}

/* Editor */
.code {
  background: #1b2b34;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.editor {
  display: grid;
  grid-template-rows: auto 1fr;
}

.editor__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 5px;
  grid-gap: 5px;
  background: rgb(0, 0, 0, .1);
}

.editor__code {
  display: grid;
  grid-template-columns: auto 1fr;
}

.editor__number {
  display: block;
  padding: 0 10px;
}

.editor__input {
  resize: none;
  background: none;
  border: 0;
  color: grey;
  font-size: 16px;
  line-height: 19px;
}

.settings {
  padding: 5px;
  background: black;
  border-top: 1px solid grey;
}

/* Pen Header */

.pen {
  align-items: center;
  background: black;
  border-bottom: 5px solid var(--grey);
  color: white;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: column;
  grid-gap: 10px;
}

.preview {
  display: grid;
}

/* Buttons */

.button {
  background: var(--grey);
  border: 0;
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-size: 15px;
  position: relative;
}

.button--small {
  font-size: 12px;
  padding: 4px;
}

.button--dirty:before {
  background: #ffc600;
  display: block;
  content: "";
  height: 2px;
  width: calc(100% - 6px);
  position: absolute;
  left: 3px;
  top: 3px;
}
              
            
!

JS

              
                
              
            
!
999px

Console