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

Untitled

A Pen By Captain Anonymous

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.

Quick-add: + add another resource

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.

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.

            
              <template id="sd-me-tmpl">
  <style>
    .frame {
      border: 1px solid green;
      padding: 5px;
      margin: 5px;
    }
    ::content sd-them {
      color: red;
    }
  </style>
  <p>sd-me</p>
  <div class="frame">
  <content></content>
  </div>
</template>

<template id="sd-you-tmpl">
  <style>
    .frame {
      border: 1px solid cyan;
      padding: 5px;
      margin: 5px;
    }
  </style>
  <p>sd-you</p>
  <div class="frame">
  <content></content>
  </div>
</template>

<template id="sd-them-tmpl">
   <style>
    .frame {
      border: 1px solid magenta;
      padding: 5px;
      margin: 5px;
    }
  </style>
  <p>sd-them</p>
  <div class="frame">
  <content></content>
  </div>
</template>


<sd-me>
   <sd-them>
     text 1
   </>
   <sd-you>
      <sd-them>
        text 2
      </>
   </>
</>
            
          
!
            
              (function () {
  'use strict';
  
	// Our templates
  var sdMeTmpl = document.querySelector('#sd-me-tmpl');
  var sdYouTmpl = document.querySelector('#sd-you-tmpl');
  var sdThemTmpl = document.querySelector('#sd-them-tmpl');

  document.registerElement('sd-me', {
    prototype: Object.create(HTMLDivElement.prototype, {
      createdCallback: {
        value: function () {
          // Install the template onto the shadow root
          var content = document.importNode(sdMeTmpl.content, true);
          this.rootElem = this.createShadowRoot();
          this.rootElem.appendChild(content);
        }
      }
    })
  });
  
  document.registerElement('sd-you', {
    prototype: Object.create(HTMLDivElement.prototype, {
      createdCallback: {
        value: function () {
          // Install the template onto the shadow root
          var content = document.importNode(sdYouTmpl.content, true);
          this.rootElem = this.createShadowRoot();
          this.rootElem.appendChild(content);
        }
      }
    })
  });
  
  document.registerElement('sd-them', {
    prototype: Object.create(HTMLDivElement.prototype, {
      createdCallback: {
        value: function () {
          // Install the template onto the shadow root
          var content = document.importNode(sdThemTmpl.content, true);
          this.rootElem = this.createShadowRoot();
          this.rootElem.appendChild(content);
        }
      }
    })
  });
}());
            
          
!
999px
Loading ..................

Console