cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

  <button>Web Components</button>
  <ul class="menu" role="menu">
    <li role="presentation"><a href="#">Custom Element</a></li>
    <li role="presentation"><a href="#">HTML Imports</a></li>
    <li role="presentation"><a href="#">Shadow DOM</a></li>
    <li role="presentation"><a href="#">HTML Templates</a></li>

              body {
  margin: 15px;

drop-down:unresolved {
  display: none;
drop-down {
  position: relative;
  display: inline-block;

drop-down button {
  background-color: #FFF;
  padding: 5px 15px;
  color: #333;
  border: 1px solid #CCC;
  border-radius: 5px;  
  outline: none;

drop-down .menu {
  list-style: none;
  padding: 5px 0;  
  border: 1px solid #CCC;
  border-radius: 5px;
  float: left;
  min-width: 100%;
  position: absolute;
  top: 100%;
  margin: 0px;
  display: none;
  background-color: white;

drop-down .menu a {
  display: block;
  padding: 3px 15px;
  clear: both;
  line-height: 1.3;
  color: #333;
  text-decoration: none;

drop-down .menu a:hover {
  text-decoration: none;
  color: #262626;
  background-color: #EEE;

drop-down button:after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
              var dropDownProto = Object.create(HTMLElement.prototype);

dropDownProto.createdCallback = function() {
  var button = this.querySelector("button");
  var menu = this.querySelector(".menu");
  button.addEventListener("click", function() {
    if(menu.style.display == 'none')
      menu.style.display = 'block';
      menu.style.display = 'none';

var DropDown = document.registerElement("drop-down", {prototype: dropDownProto});
Loading ..................