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>
<span class="align-icon al"></span>
<span class="align-icon ac"></span>
<span class="align-icon ar"></span>
<span class="align-icon aj"></span>
</div>

<div class="x2">
<span class="align-icon al"></span>
<span class="align-icon ac"></span>
<span class="align-icon ar"></span>
<span class="align-icon aj"></span>
</div>

<div class="x3">
<span class="align-icon al"></span>
<span class="align-icon ac"></span>
<span class="align-icon ar"></span>
<span class="align-icon aj"></span>
</div>
              
            
!

CSS

              
                .align-icon {
  font-size:26px; // Icon Size
  font-family: "serif", Verdana;
  display:inline-block;
  line-height:.4em;
  margin: 1em;
  width: 1em;
  height:1em;
  white-space:pre-wrap;
  position:relative;
  &:after {
    content:"\2013\A\2013"; // En dash
    display:block;
  }
  &:before {
    content:"\2014\A\2014"; // Em dash
    position:absolute;
    top:.2em;
  }
  &.ac:after {text-align:center;}
  &.ar:after {text-align:right;}
  &.aj:after {content:"\2014\A\2014";}
  .x2 & {
    font-size:52px;
  }
  .x3 & {
    font-size:78px;
  }
}
              
            
!

JS

              
                /*

Created with overlapping pairs of em and en dash characters.

Can be scaled by adjusting .align-icon font-size although some values create unequal spaces between the lines. 

Tested on several platforms in Chrome, Firefox, Safari, and IE8+

What's with the font stack? There is no extra space around the em dash character in Verdana. On Android though, Verdana falls back to Droid Sans which has a space. Specifying "serif" in quotes fixes the alignment on Android.

*/
              
            
!
999px

Console