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.

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.

HTML

              
                <div class="message success">
  <svg viewBox="0 0 56.693 56.693">
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-complete"></use>
  </svg>
  <h1>
    Zoom Allowed
  </h1>
  <p>
    <img src="http://www.fillmurray.com/640/480" alt="">
    Look, it’s a photo of Bill Murray that is being shown way smaller than actual size. Imagine if there was some important detail we needed to see in order to solve a murder case and you wanted to impress your boss by saying <em>enhance</em> loudly but were really just spread-zooming on the trackpad. Then you’d look awesome.
  </p>
  <p>
    Example from my blog post <em><a href="http://adrianroselli.com/2015/10/dont-disable-zoom.html">Don’t Disable Zoom</a></em>. I borrowed this alert message box thinger from <a href="https://codepen.io/aardrian/pen/rVZKoR">another pen I made to test SVGs</a>.
  </p>
</div>


<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="SVGsprites">
  <defs>
    <g id="icon-complete" aria-labeledby="title-02" aria-describedby="desc-02" role="image">
      <title id="title-02">Checkmark icon</title>
      <desc id="desc-02">Symbol showing a checkmark.</desc>
      <path d="M51.858 10.72c-.653-.15-1.834-.295-3.616-.447-1.827-.153-2.956-.168-3.555-.053-.606.117-1.7.672-3.348 1.7-1.6 1-4.05 2.975-7.283 5.865-3.232 2.896-6.387 6.062-9.377 9.41-2.786 3.117-5.517 6.44-8.13 9.89-.978-2.918-1.983-4.97-3.07-6.254-1.22-1.448-2.33-2.27-3.386-2.51-.845-.195-1.934-.01-3.335.567-1.44.59-2.275 1.353-2.483 2.268-.157.69.17 1.687 1.03 3.14 1.518 2.563 2.788 5.236 3.777 7.95.634 1.69 1.067 2.72 1.324 3.145.216.356.758.832 3.05 1.354 1.17.268 2.134.402 2.865.402.783 0 1.34-.152 1.69-.457.575-.48 1.722-1.947 3.506-4.486 4.283-6.155 9.23-11.925 14.704-17.153 5.473-5.226 10.323-9.077 14.41-11.44 1.25-.69 1.49-.88 1.573-.946.267-.217.438-.48.506-.775.102-.448-.07-.99-.855-1.17z"/>
    </g>
</svg>
              
            
!

CSS

              
                body {
  background-color: #6D695C;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAA3RSTlMmDQBzGIDBAAAAG0lEQVR42uXIIQEAAADCMHj/0NdkQMws0HEeAqvwAUGJthrXAAAAAElFTkSuQmCC);
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
  padding: 0;
  margin: 0;
}

h1 {
  font-size: 150%;
  margin: .75em 0 .5em 0;
}

img {
  float: right;
  width: 50px;
  height: auto;
  max-width: 25%;
  margin: 0 0 1em 1em
}

#SVGsprites {
  display: none;
}

.message {
  box-sizing: border-box;
  border: 2px solid #ccc;
  background-color: #fff;
  padding: .5em 1em .5em 70px;
  margin: 1em 2em;
  border-radius: .5em;
  min-height: 70px;
  position: relative;
}

.message svg {
  position: absolute;
  top: .5em;
  left: 10px;
  width: 50px;
  height: auto;
}

.message.success {
  border-color: #6c6;
}

.message.success svg {
  fill: #6c6;
}

.message.success h1 {
  color: #35a035;
}

message.alert {
  border-color: #f99;
  box-shadow: 0 0 20px rgba(255,0,0,.5);
}

.message.alert svg {
  fill: #f99;
}

.message.alert h1 {
  color: #ff5d5d;
}

.message.alert.throbbing {
    animation: alertBorderThrob 1s infinite alternate;
}

.message.alert.throbbing svg {
  animation: alertSVGThrob 1s infinite alternate;
}

@keyframes alertBorderThrob {
  from {
    border-color: #f99;
    box-shadow: 0 0 20px rgba(255,0,0,.5);
    animation-timing-function: linear;
  } to {
    border-color: #f00;box-shadow: 0 0 20px rgba(255,0,0,1);
  }
}

@keyframes alertSVGThrob {
  from {
    fill: #f99;
    animation-timing-function: linear;
  } to {
    fill: #f00;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console