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

              <input id="button" class="button__check" type='checkbox'>
<label for="button" class="button__label" onclick></label>
<div class="target">
  <div class="box one"></div>
  <div class="box two"></div>
              @import url(https://fonts.googleapis.com/css?family=Montserrat);

.button__check {
  /* Hide the checkbox from view */
  position: absolute;
  left: -999em;
.button__label {
  display: inline-block;
  font-family: Tahoma, sans-serif;
  border:1px solid #777;
  border-radius: 3px;
  background: #944;
  padding: 10px;
  cursor: pointer;
  width: 180px;
  text-align: center;
  transition: background 0.5s ease-in-out;
  margin-bottom: 15px;

.target {
  width: 300px;
  height: 300px;
  background: #444;
  border: 1px solid #666;
  position: relative;

.box {
  position: absolute;
  width: 100px;
  height: 100px;
  background: #444;
  border:1px solid #666;
  transition: all 0.85s ease-in-out;

.box.one {
  left: 40px;
  top: 40px;

.box.two {
  right: 40px;
  bottom: 40px;

/* Apply an animated state to the .box elements
when they are within a sibling of a checked .button__check
NOTE: you _must_ include the siblig .target in the selector */
.button__check:checked ~ .target .box {
  background: #6F6;
  transform: scale(1.25, 1.25) rotate(45deg);

/* This "adjacent sibling" rule matches all divs with class .target _only when_ they are siblings of a checked checkbox with class = "button__check" */
.button__check:checked ~ .target {
  background: #DDD;
  border: 1px solid #888;

/* Style and content for the label when "on" */
.button__check:checked ~ label {
  background: #494;

.button__check:checked ~ label:after {
  content: "Button On";

/* Style and content for the label when "off" */
.button__check:not(:checked) ~ label:after {
  content: "Button Off";
Loading ..................