Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <boton-x nombre-epico="Fili Santillán" url-epica="http://filisantillan.com/"></boton-x>

<boton-x nombre-epico="Nombre-1" url-epica="http://nombre-1.com"></boton-x>

<boton-x nombre-epico="Nombre-2" url-epica="http://nombre-2.com"></boton-x>

              
            
!

CSS

              
                boton-x {
  padding: 10px 20px;
  display: inline-block;
  background: #4299D4;
  border-radius: 5px;
  margin: 20px;
  box-shadow: 4px 4px 0 #1E252A;
  border: 1px solid #1E252A;
}

boton-x::shadow .link-x {
  color: #1E252A;
  text-decoration: none;
  font-family: 'Arial';
  font-size: 23px;
  letter-spacing: 4px;
}


              
            
!

JS

              
                var miBoton = Object.create(HTMLElement.prototype);

miBoton.createdCallback = function() {

    var shadow = this.createShadowRoot(); // Creamos el Shadow Root
  
    var link = document.createElement("a"); // Creamos nuestro elemento "<a>"
    link.innerText = this.getAttribute("nombre-epico"); // Insertamos el valor que hay en "nombre-epico" como nodo en "<a>"
    link.href = this.getAttribute("url-epica"); // Agregamos el atributo href con el valor de "url-epica"
    link.className = "link-x"; // Agregamos la clase link-x
  
    shadow.appendChild(link); // Agregamos <a> al Shadow Root
};

var botonX = document.registerElement("boton-x", { 
    prototype: miBoton
});
              
            
!
999px

Console