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.

              <h1>Shadow Dom Test</h1>
<h2 class="notice">In Chrome, turn on the "Enable experimental Web Platform features" in about:flags to experiment with everything covered in this example.</h2>

<template id="buttonTemplate">
    button{color: blue;}
    :host{ width: 200px; display: block; background-color: #999; text-align: center;}
    :host(.big) button{font-size: 1em;}
    :host-context(.theme-emphasis) button{text-transform: uppercase;}
    ::content .name2{color: red;}
  <button><content select=".name1"></content> button !</button>
  <button><content select=".name2"></content> button !</button>

<h2>button using webcomponents</h2>

<section class="theme-emphasis">
  <div id="buttons" class="big">
    <p class="name1">super</p>
    <p class="name2">ultra</p>

  padding: 30px;

  font-style: italic;
  color: red;
  font-size: 10px;

#buttons::shadow button {
  text-decoration: underline;

body /deep/ .name1{
  color: red;
  var shadow = document.querySelector('#buttons').createShadowRoot();
  var template = document.querySelector('#buttonTemplate');
  var clone = document.importNode(template.content, true);

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................