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.

              <div class="panel">
  <button type="button" class="button">Hello world!</button>

<div class="panel green-panel">
  <button type="button" class="button">Hello world!</button>

<div class="panel orange-panel">
  <button type="button" class="button">Hello world!</button>
              @import "compass/css3";

@import 'compass';

@mixin alpha-attribute($attribute, $color, $background: white) {
  $percent: alpha($color) * 100%;
  $opaque: opacify($color, 1);
  $solid-color: mix($opaque, $background, $percent);
  @if ($percent < 100%) { #{$attribute}: $solid-color; }
  #{$attribute}: $color;

@mixin color-button($text, $color, $background: white) {
  @include alpha-attribute('background', $color, $background);
  border: 1px solid;
  @include alpha-attribute('border-color', rgba(black, 0.7), $background);
  @include alpha-attribute('color', $text, $background);
  @include box-shadow(rgba(white, 0.2) 0 1px 0 inset);
  &:focus, &:hover {
    @include alpha-attribute('background', transparentize($color, 0.2), $background);
    @include alpha-attribute('color', opacify($text, 1), $background);
  &:focus {
    outline: none;
  &:active {
    @include alpha-attribute('background', opacify($color, 0.1), $background);
    @include box-shadow(none);

.button {
  @include appearance(none);
  font-family: sans-serif;
  font-size: 14px;
  padding: 0.4em 1em 0.5em;
  -webkit-font-smoothing: antialiased;
  @include color-button(rgba(white, 0.8), rgba(black, 0.5));
  cursor: pointer;

.panel {
  @include box-sizing(border-box);
  width: 220px;
  padding: 50px;
  text-align: center;
  margin: 15px;
  background: gray;
  float: left;
  .button { @include color-button(rgba(white, 0.8), rgba(black, 0.5), gray); }

.green-panel {
  background: #393;
  .button { @include color-button(rgba(white, 0.8), rgba(black, 0.5), #393); }

.orange-panel {
  background: #f73;
  .button { @include color-button(rgba(white, 0.8), rgba(black, 0.5), #f73); }

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