cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - 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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <p class="explanation">This is old kinda bad version, demonstrating the height problem.</p>

<div class="tabs">

  <div class="tab">
    <input type="radio" id="tab-1" name="tab-group-1" checked>
    <label for="tab-1">Breakfast</label>

    <div class="panel">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9632/bacon.jpg" alt="mountain" / 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>

  <div class="tab">
    <input type="radio" id="tab-2" name="tab-group-1">
    <label for="tab-2">Dinner</label>

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

  <div class="tab">
    <input type="radio" id="tab-3" name="tab-group-1">
    <label for="tab-3">Dessert</label>

    <div class="panel">
      <li>A whole red velvet cake</li>
      <li>Rocky road ice cream</li>
      <li>S'mores</li>
    </div> 
  </div>
            
          
!
            
              .tabs {
  position: relative;   
  min-height: 200px; /* This part sucks */
  clear: both;
  margin: 25px 0;
}

.tab {
  float: left;
}
.tab label {
  background: #eee; 
  padding: 10px; 
  border: 1px solid #ccc; 
  margin-left: -1px; 
  position: relative;
  left: 1px;
}

.tab [type=radio] {
  display: none; 
}

.panel {
  position: absolute;
  top: 36px;
  left: 0;
  background: white;
  right: 0;
  bottom: 0;
  padding: 20px;
  border: 1px solid #ccc; 
}

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

[type=radio]:checked ~ label {
  background: white;
  border-bottom: 1px solid white;
  z-index: 2;
}

[type=radio]:checked ~ label ~ .panel {
  z-index: 1;
}





body {
  background-color: #ddd;
	font-family: Helvetica, Arial, sans-serif;
  font-size: 1.25em;
  line-height: 1.5;
  padding: 20px;
}
p {
  margin-bottom: 15px;
}
.explanation {
  background: lightyellow;
  padding: 2px;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console