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="box speech-bottom success">
  <em>Everything is</em><br/>
  <strong style="font-size: 50px;">OK</strong>
</div>
<div class="box speech-bottom error speech-push-right">
  <span style="font-size: 30px;">Oops!</span><br/>
  Something <strong>wrong</strong> happened!
</div>
<div class="box speech-bottom">
  Hi, I'm SpeechDiv Threepwood, <br/>
  a mighty pirate!<br/>
  <strong>Really!</strong>
</div>
<div class="box">
  Here's what you need for a barrel of Grog:
  <ul>
    <li>Kerosene</li>
    <li>Propylene Glycol</li>
    <li>Artificial sweeteners</li>
    <li>Sulphuric acid</li>
    <li>Rum</li>
    <li>Acetone</li>
    <li>Red dye nº2</li>
    <li>SCUMM</li>
    <li>Axle grease</li>
    <li>Batery acid</li>       
  </ul>
  And/or
  <ul>
    <li>Pepperoni</li>
  </ul>
</div>
              
            
!

CSS

              
                @import "compass/css3";

/* apply a natural box layout model to all elements */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

body
{
  background: #345;
}

.box.error
{
  border-color: #922;
  background: #922;
  color: white;
}

.box.success
{
  border-color: #292;
  background: #292;
  color: white;
}

.box
{
  min-width: 50px;
  min-height: 40px;
  border-color: #CCC;
  background-color: #CCC;
  color: #555;
  display: inline-block;
  position: relative;
  padding: 10px;
  font-size: 13px;
  margin: 20px;
  border-radius: 10px;  
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.2),
              inset -1px -1px 0px rgba(0, 0, 0, 0.6),
              0 14px 6px -10px rgba(0, 0, 0, 0.3);
}

.speech-top:after
{
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  top: -19px;
  left: 10px;
  border: 10px solid;
  border-color: transparent;
  border-bottom-color: inherit;  
}

.speech-bottom:after
{
  content: "";
  position: absolute;
  width: 0px;
  height: 0px;
  top: 100%;
  left: 10px;
  margin-top: -2px;
  border: 10px solid;  
  border-color: transparent;
  border-top-color: inherit;
}

.speech-push-right:after
{
  left: 100%;
  margin-left: -30px;
}
              
            
!

JS

              
                $(document).ready(function(){
  $('.box').each(function(){
    var randDegrees = Math.round(Math.random()*40)-20;    
    $(this).css('transform','rotate('+randDegrees+'deg)');
  });
});
              
            
!
999px

Console