Pen Settings

HTML

CSS

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.

+ 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

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.

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

              
                <p>Example 0 - single; icon size 16px without padding</p>
<a class="example-0 talk-action-link" href="#">Talk</a>

<p>Example 1 - single; icon size 16px</p>
<a class="talk-action-link" href="#">Talk</a>

<p>Example 2 - sprite; icon size 16px</p>
<ul class="contact-list">
  <li class="contact-action contact-info-action">
    <a class="contact-action-link contact-info-action-link" href="#"><span class="label">Show Contact Info</span></a>
  <li class="contact-action contact-add-action">
    <a class="contact-action-link contact-add-action-link" href="#"><span class="label">Add Contact</span></a>
  <li class="contact-action contact-list-action">
    <a class="contact-action-link contact-list-link" href="#"><span class="label">Show Contact List</span></a>
</ul>

<p>Example 3 - single; icon size 48px; CSS-resized to 16px</p>
<a class="dismiss-action-link" href="#">Dismiss</a>

<p>Example 4 - sprite; icon size 48px; CSS-resized to 16px</p>
<ul class="playback-list">
  <li class="playback-action play-action">
    <a class="playback-action-link play-action-link" href="#"><span class="label">Play</span></a>
  <li class="playback-action pause-action">
    <a class="playback-action-link pause-action-link" href="#"><span class="label">Pause</span></a>
  <li class="playback-action stop-action">
    <a class="playback-action-link stop-action-link" href="#"><span class="label">Stop</span></a>
</ul>

<p>Example 5 - sprite; icon size 48px; active area 72px</p>
<ul class="playback-list example-5">
  <li class="playback-action play-action">
    <a class="playback-action-link play-action-link" href="#"><span class="label">Play</span></a>
  <li class="playback-action pause-action">
    <a class="playback-action-link pause-action-link" href="#"><span class="label">Pause</span></a>
  <li class="playback-action stop-action">
    <a class="playback-action-link stop-action-link" href="#"><span class="label">Stop</span></a>
</ul>
              
            
!

CSS

              
                /* Image replacement from https://github.com/h5bp/html5-boilerplate/blob/v4.3.0/css/main.css */
.ir,
.talk-action-link,
.contact-action-link .label,
.dismiss-action-link,
.playback-action-link .label {
  background-color: transparent;
  border: 0;
  overflow: hidden;
  /* IE 6/7 fallback */
  *text-indent: -9999px;
}

.ir:before,
.talk-action-link:before,
.contact-action-link .label:before,
.dismiss-action-link:before,
.playback-action-link .label:before {
  content: "";
  display: block;
  width: 0;
  height: 150%;
}

/* Example 1 */
.talk-action-link {
  display: block;
  width: 48px;
  height: 48px;
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDY4NkE3Nzk5Rjk5MTFFNDhEOUNGQkFDQjE1RjU2MkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDY4NkE3N0E5Rjk5MTFFNDhEOUNGQkFDQjE1RjU2MkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0Njg2QTc3NzlGOTkxMUU0OEQ5Q0ZCQUNCMTVGNTYyRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0Njg2QTc3ODlGOTkxMUU0OEQ5Q0ZCQUNCMTVGNTYyRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmtM/kcAAADQSURBVHjaYvj//z8DCKMBRiCuAuI3UFwFFYMDuD4cBsSD1KDheFIMWITFgEXYDGBiwA6YiRTDaQDRgOoG8BGhhw+fAQ+BmBWI/2LR+A8q9xCfAc+AWBeI92ExYC8Q60DVYIlPCKgG4pVICektFMMS0kqoGpzpgBOIzwLxJCDmQrKHCyp2FqoGb0ISBOKFUJu3Q/FrqJggsSkRBMSAeDcUi6FLwvSx4ImuV1DMgERjAiwuyAfiI0D8HBqdf6Hso1A5olzACI3iv2jRjeFXgAADAMcOjTz7Ov01AAAAAElFTkSuQmCC');
  background-repeat: no-repeat;
  background-position: center center;
}

/* Example 0 */
.example-0.talk-action-link {
  width: 16px;
  height: 16px;
}

/* Example 3 */
.dismiss-action-link {
  display: block;
  width: 48px;
  height: 48px;
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTFCMzlDNjU5RjhGMTFFNEE2MThBQUQwOTNBNkRGN0UiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTFCMzlDNjY5RjhGMTFFNEE2MThBQUQwOTNBNkRGN0UiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBMUIzOUM2MzlGOEYxMUU0QTYxOEFBRDA5M0E2REY3RSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBMUIzOUM2NDlGOEYxMUU0QTYxOEFBRDA5M0E2REY3RSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PnA4MXYAAAGmSURBVHja1JpfTgIxEIdHL6VRb7LKs1FwwfMQj2BAvQPqVYxGE8UXQ50uLSEGsZ3OnzrJ74mZ8n1ZuiTbBVjWDuYYM8N8YJ4xU8we2Nch5hbzivnEPGBOfjZdYdyGfGHODOEHgWET2zg2Nb80xCwwrQH86A8uF9i7n42rTCIF3gV2mCc2a0mkwrvADi8ZA9ISOfAusHd3G1eBRC68z8QPHmzZ6VoSFHjPvB8X6BMW4JIYEb/7lGuh1gD+gnvBtgZ4TQkxeA0JcXhJCTV4CQl1eE4JM3gOCXP4Uokq4EskqoGXllCBl5JQheeWMIHnkjCFL5Vggd9lEIhA1FnTGhLv9etXYfBf4U0luOBNJLjhVSWk4FUkKPCLWiSo8H7u0lqiBD6WmQQHvJkEJ7y6hAS8moQkvLiEBryYhCY8u8S5AXypxOrxOvWAY8j4R0mRWB1wTI3hSySuAfIP+STgqRJPfmheCTxF4t0PzBKbNeBzJbqD7qYy+ByJJjaPt+z0vuFDgxYSXvaI5V9huQ97wm/sG1g7hzWsI8wd5g2Wr9s8Ynrxw28BBgDVRknJM1O/hwAAAABJRU5ErkJggg==');
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: center center;
}

/* Background color on hover */
.talk-action-link:hover,
.dismiss-action-link:hover,
.contact-action-link:hover,
.playback-action-link:hover {
  background-color: #bfbfbf;
}

/* List style reset */
.contact-list,
.playback-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* To put icons side-by-side */
.contact-list li,
.playback-list li {
  display: inline-block;
}

/* Sets the overall size of the active area to 48px */
.playback-action-link,
.contact-action-link {
  display: block;
  width: 48px;
  height: 48px;
  text-align: center;
  line-height: 48px;
}

/* Sets the size of the icon */
.playback-action-link .label {
  display: inline-block;
  width: 16px;
  height: 16px;
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0FBQjk5ODQ5Rjk0MTFFNEFFMjFDN0E2OEMzREQzQzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0FBQjk5ODM5Rjk0MTFFNEFFMjFDN0E2OEMzREQzQzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZD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BdzoJns/qBwbH3Hcf7/1huVZAbzrcqCGWzjkmLm3WciwZv1vF3c5AsAuzX7Wr09jHPoz/bx3TUe/lZkdvVDIxnvFUBsf/vBREUgAIQpgLEcXwUvAM2wJ/ypVfH3FaxJYdjoQqQughjwJfw8gQ87kmen8EZ5Po0eAHU2SY7Sfl21n0FzyPfT6Fb0C0Piy84onILfgbIFeSkp/m+Rb5nQhdA9lEb8zTfLvKthyRAmgWNeZzvWBQYeB1AASgAQQEoAEEBKABBASgAQQEoAEEBKABBASgAQQEoAEEBKABBASgAQQEoAEEBKABBASgAUbAAXY/z7VZBgJbH+X6oggA+bzfzODQB0p4PkOfCXkT+PSXzDbyAfD8GPQMwwC28XAG3PMrzC3g1tOKnzoDETJBnsq6BJyKzf15vA/KkznvwEXg3tIfzhgpA8DqAAhAUIHj8FmAA8QczmsWIL8cAAAAASUVORK5CYII=');
  background-size: 200% 200%;
  background-repeat: no-repeat;
  vertical-align: middle;
}

.pause-action .label {
  background-position: -16px 0;
}

.stop-action .label {
  background-position: 0 -16px;
}

/* Contact List */
.contact-list .label {
  display: inline-block;
  width: 16px;
  height: 16px;
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJ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yFGQlI1kac5KToCzpfQFn2Jr3IOkUAz46rz5a8wr8NcyCdnAZBMEc2GDzETr7r+IhpHn5WXCCnlvBc0MnhG6JflWy5GSgF+QVZ5mnOd2xPWKBKP6nQSdfbFnWHlxiYMcmki2aiylefgysavTWQbeTA0E6a8uBAq2V4yhjoJeXj0XlQMLASI2EpHfVhd51nQOzLgzNSnppF3rzOgdKLgyV6tT7xh2QUyXnolrmGtDbd/f4D6req1JQvsmGQFQam9KkV90OCPgOXKLL5DC94C6YBD3UaHDZAotOX6QTP+uCioqicwEsUF3oYHNlKrN1OyBL1Gabk5poL/EtdUuIpVNVUaCK9HschNncz0a/msfAHXBDen5D3cxpcFGhL8rqtFcxUJNhCsYVcI8ujwn5GmX93hWvHQhTsH2mjqbhvDYVkf8PqFOxqPkQVW7QLoe9oCZd1KupskAE2rVmOhBgDaiK73QZNcWBuGEle9gsB0zr+Q9wqBkObLqo5+e9dkCc/0vDLBH9/Qevy/I/AQYAyxbaQGtE1l0AAAAASUVORK5CYII=');
  vertical-align: middle;
}

.contact-add-action .label {
  background-position: -16px 0;
}

.contact-list-action .label {
  background-position: 0 -16px;
}

/* Example 5 */
.example-5 .playback-action-link {
  width: 72px;
  height: 72px;
  line-height: 72px;
}

.example-5 .playback-action-link .label {
  width: 48px;
  height: 48px;
}

.example-5 .pause-action .label {
  background-position: -48px 0;
}

.example-5 .stop-action .label {
  background-position: 0 -48px;
}
              
            
!

JS

              
                
              
            
!
999px

Console