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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="message alert throbbing">
  <svg viewBox="0 0 56.693 56.693">
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-alert"></use>
  </svg>
  <h1>
    Zoom Disabled
  </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 like an idiot.
  </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-alert" aria-labeledby="title-03" aria-describedby="desc-03" role="image">
      <title id="title-03">Alert icon</title>
      <desc id="desc-03">Exclamation mark within a triangle.</desc>
      <path d="M52.169 42.747L32.771 8.572c-.945-1.666-2.711-2.693-4.625-2.693-1.916 0-3.682 1.027-4.627 2.693L4.121 42.747c-.935 1.646-.923 3.666.029 5.303.952 1.635 2.704 2.643 4.597 2.643h38.795c1.894 0 3.644-1.008 4.597-2.643.953-1.637.964-3.657.03-5.303zm-21.374 1.666c-.65.578-1.422.871-2.292.871-.881 0-1.66-.289-2.318-.859-.672-.584-1.014-1.402-1.014-2.432 0-.904.322-1.684.957-2.317.634-.634 1.42-.956 2.336-.956.914 0 1.706.32 2.354.953.649.635.979 1.416.979 2.32-.001 1.016-.338 1.829-1.002 2.42zm.861-22.005l-.845 9.678c-.095 1.205-.299 2.113-.623 2.774-.357.729-.98 1.116-1.803 1.116-.839 0-1.457-.379-1.788-1.095-.294-.638-.496-1.563-.619-2.832l-.63-9.419c-.119-1.861-.178-3.16-.178-3.971 0-1.172.319-2.107.948-2.779.635-.678 1.478-1.023 2.502-1.023 1.264 0 2.128.459 2.57 1.363.406.834.604 1.986.604 3.521.002.87-.045 1.766-.138 2.667z"/>
    </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