Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <p>This demo is working only for Firefox at the moment.<br>See browser support at <a href="">Can I Use</a></p>

<div contextmenu="menu" id="box">
  Right click to get the context menu demo.
<menu type="context" id="menu">

  <menuitem type="checkbox" id="move">I like to move it, move it</menuitem>

  <menuitem type="command" label="Test me" id="custom">Hello World!</menuitem> 
  <menuitem type="radio" name="aligngroup" value="left">Align Left</menuitem>

  <menuitem type="radio" name="aligngroup" value="right">Align Right</menuitem>

  <menuitem type="radio" name="aligngroup"  checked="true" value="center">Align Center</menuitem>
  <menuitem type="checkbox" disabled>Disabled menu item</menuitem>
              .move {
  animation: turn infinite 3s linear;
@keyframes turn {
  100% {
    transform: rotate(1turn);

#box.alignleft {
  margin-left: 0;
#box.alignright {
  margin-right: 0;

/* Just decorative things */
body {
  text-align: center;
  font-family: sans-serif;
  line-height: 1.7;
  letter-spacing: 0.01em;
#box {
  width: 200px;
  max-width: 100%;
  padding: 20px;
  margin: 2em auto;
  background: #2FB6B6;
  color: #FFF;
  font-weight: bold;

#menu:before {
  content: "If you see that menu it's because your browser is not compatible with contextmenu";
  display: block;
  width: 600px;
  padding: 20px;
  max-width: 100%;
  margin: auto;
  background: #F2F2F2;
  font-weight: bold;
  font-size: 0.875em;
menuitem {
  display: inline-block;
  margin: 1em .1em;
  padding: .5em;
  background: #AE94C0;
  color: #F2F2F2;
  font-weight: bold;
  font-size: 0.875em;
menuitem:hover {
  background: #333;
  cursor: pointer;
menuitem[disabled] {
  background: #F2F2F2;
  color: #666;
  cursor: not-allowed;
              var move    = document.getElementById('move'),
    box     = document.getElementById('box'),
    custom  = document.getElementById('custom'),
    radios  = document.querySelectorAll('[name="aligngroup"]'); 

// moooove action
move.addEventListener('click', function() {
  if ( ! box.classList.contains('move') ) {
  } else {
} );

// custom
custom.addEventListener('click', function() {
  alert('This text menu should be "' + this.childNodes[0].nodeValue + '" but label attribute rules the displayed text.' );
} );

// radios
for ( var key in radios ) {
  if ( typeof radios[key] === 'object' ){
    radios[key].addEventListener('click', function() {
      box.classList.remove('aligncenter', 'alignleft', 'alignright');
      box.classList.add('align' + this.getAttribute('value') );
    } )

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.