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.

              <div id="container">
  <h2 class="header">This is the Title</h2>
  <p class="one">This is one paragraph.</p>
  <p class="two">This is another paragraph.</p>
  <ul class="footer">
    <li><a href="#">Link 1</a></li>
    <li><a href="#">Link 2</a></li>

<template id="sdom">
    <content select="h2"></content>
    <content select="p.two"></content>
    <content select="p.one"></content>
    <content select="ul.footer"></content>
              .header {
  border-bottom: 1px solid #efefef;
.footer {
  border-top: 1px solid #efefef;
  list-style-type: none;

.footer li {
  float: left;
  margin-right: 3px;
.footer li a {
  font-size: 11px;
  font-weight: normal;
  text-decoration: none;
var container = document.querySelector('#container');
var root      = container.createShadowRoot();

var t     = document.querySelector('#sdom');
var clone = document.importNode(t.content, true);


var html = [];
[].forEach.call(root.querySelectorAll('content'), function(el) {
  html.push(el.outerHTML + ': ');
  var nodes = el.getDistributedNodes();
  [].forEach.call(nodes, function(node) {

var host = document.querySelector('#container');
var root = host.createShadowRoot();
var template = document.querySelector('#sdom');
Loading ..................