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="tabs">

  <input class="switch" type="radio" title="Breakfast" name="switch" id="breakfast" checked="">
  <input class="switch" type="radio" title="Dinner" name="switch" id="dinner">
  <input class="switch" type="radio" title="Dessert" name="switch" id="dessert">

  <div class="tab-links">
    <label for="breakfast" id="breakfast-tab" class="tab">Breakfast</label>
    <label for="dinner" id="dinner-tab" class="tab">Dinner</label>
    <label for="dessert" id="dessert-tab" class="tab">Dessert</label>
  </div>

  <div class="panels">

    <div id="breakfast-panel" class="panel active">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9632/bacon.jpg" align="left" alt="Gimme Bacon!">
      <p>Breakfast will be a exquisite pile of bacon served on a Thanksgisving platter. No eggs, no toast and no orange juice. Serves 1 person.

      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis.</p>
    </div>

    <div id="dinner-panel" class="panel">
      <p>Dinner will be graciously catered by Taco Bell. Get ready for a literal and figurative blast!</p>
    </div>

    <div id="dessert-panel" class="panel">
      <li>A whole red velvet cake</li>
      <li>Rocky road ice cream</li>
      <li>S'mores</li>
      <li>Cotton candy (the multicolored kind)</li>
      <li>Krispy Kreme glaze donuts</li>
      <li>Coffee (no decaf allowed)</li>
      <li>A toothbrush</li>
    </div>

  </div>

</div>
            
          
!
            
              /* DEMO STYLES */

.tabs .switch {
  position: absolute;
  z-index: 1;
}

.tabs .tab {
  display: inline-block;
  position: relative;
  cursor: pointer;
  z-index: 2;
}

#breakfast:checked ~ .tab-links #breakfast-tab,
#dinner:checked ~ .tab-links #dinner-tab,
#dessert:checked ~ .tab-links #dessert-tab {
  background-color: #fff;
  color: #000;
  cursor: default;
}

.tabs .panels {
  background-color: #fff;
  padding: 20px;
}
.tabs .panel {
  position: absolute;
  display: inline-block;
  left: -9999;
  bottom: -9999;
  opacity: 0;
}

/* This is the magic - http://alistapart.com/article/radio-controlled-web-design */
#breakfast:checked ~ .panels #breakfast-panel,
#dinner:checked ~ .panels #dinner-panel,
#dessert:checked ~ .panels #dessert-panel {
  position: relative;
  left: 0;
  opacity: 1;
}

/* PRESENTATIONAL STYLES */
body {
  background-color: #333;
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.5;
  padding: 20px;
}

p {
  margin-bottom: 15px;
}

img {
  margin: 0 15px 15px 0;
  width: 25%;
}

.tabs .tab {
  padding: 10px;
  background-color: #000;
  color: #fff;
}

.tabs .tab:hover {
  background-color: #ddd;
  color: #000;
}

            
          
!
            
              // Based off Art Lawry's "Radio-Controlled Web Design: http://alistapart.com/article/radio-controlled-web-design
            
          
!
999px
Close

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.

Go PRO

Loading ..................

Console