cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

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.

              <img src="http://blattchat.com/wp-content/uploads/2013/05/thief_bw.png"/>
<img src="http://blattchat.com/wp-content/uploads/2013/05/thief_bw.png" class="recolor"/>
<form action="#">
  <label for="black">Map Black To: </label>
  <input type="color" id="black" value="#FF6600"/>
  <label for="white">Map White To: </label>
  <input type="color" id="white" value="#3300FF"/>
<i>Thief image courtesy of Igor Yanovskiy, from The Noun Project</i>

<svg width="0" height="0">
    <filter id="DuotoneFilter">
        <feFuncR id="funcR" type="table" tableValues="1 .2"/>
        <feFuncG id="funcG" type="table" tableValues="0.4 0"/>
        <feFuncB id="funcB" type="table" tableValues="0 1"/>        
              img.recolor {
  -webkit-filter: url(#DuotoneFilter); 
  filter: url(#DuotoneFilter);

              jQuery('#black').change(function() {

jQuery('#white').change(function() {

function remapBlack(color) {
  remapColor(color, 0);

function remapWhite(color) {
  remapColor(color, 1);

function remapColor(color, index) {
  var red = parseInt(color.substr(1, 2), 16);
  var funcR = document.getElementById('funcR');
  var tableValues = funcR.getAttribute('tableValues').split(' ');
  tableValues[index] = red / 255;
  funcR.setAttribute('tableValues', tableValues.join(' '));
  var green = parseInt(color.substr(3, 2), 16);
  var funcG = document.getElementById('funcG');
  var tableValues = funcG.getAttribute('tableValues').split(' ');
  tableValues[index] = green / 255;
  funcG.setAttribute('tableValues', tableValues.join(' '));
  var blue = parseInt(color.substr(5, 2), 16);
  var funcB = document.getElementById('funcB');
  var tableValues = funcB.getAttribute('tableValues').split(' ');
  tableValues[index] = blue / 255;
  funcB.setAttribute('tableValues', tableValues.join(' '));  


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 ..................