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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>vertical tab css html only</h1>
<div class="vertical-tab">
  <section id="section1">
    <input type="radio" name="sections" id="option1" checked>
    <label for="option1">the first test</label>
    <article>
      <h2>The first test</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eius ipsam deserunt id, voluptatem rerum velit necessitatibus doloribus eum hic, ipsum delectus cum vero commodi itaque laboriosam! Animi maxime inventore dolores.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat perspiciatis eius, molestias voluptatibus at ipsam porro, illum dicta repellat neque sit suscipit, maiores repellendus? Ipsam excepturi nam repudiandae, corporis quae!</p>
    </article>
  </section>
  <section id="section2">
    <input type="radio" name="sections" id="option2">
    <label for="option2">the second test</label>
    <article>
      <h2>the second test</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit consectetur praesentium molestias qui saepe, voluptatum consequuntur tenetur nobis numquam perferendis quas culpa veritatis earum rerum, ducimus quam. Veritatis, incidunt, ad?</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore ullam, deserunt doloribus neque itaque at ipsam qui eaque sed et aspernatur, error nesciunt. Animi, nihil, vero! Quo nemo reiciendis, harum.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia earum quam necessitatibus, similique maiores nostrum deleniti tempore, voluptatum, quasi sint explicabo ex dolores autem quo nihil, soluta illo incidunt fuga.</p>
    </article>
  </section>
  <section id="section3">
    <input type="radio" name="sections" id="option3">
    <label for="option3">the third test</label>
    <article>
      <h2>the third test</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate, praesentium ipsa illum officiis nulla, quas hic at odio, iste quam voluptas temporibus nobis aliquam reiciendis natus adipisci sunt non. Placeat.</p>
    </article>
  </section>
  <section id="section4">
    <input type="radio" name="sections" id="option4">
    <label for="option4">the fourth test</label>
    <article>
      <h2>the fourth test</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut nihil enim, eveniet architecto deleniti necessitatibus cumque pariatur rerum consequatur temporibus. Temporibus ipsam doloremque fugit. Aliquam enim totam minus reprehenderit quam?</p>
    </article>
  </section>
</div>
            
          
!
            
              h1 {
  color: #333;
  font-family: arial, sans-serif;
  margin: 1em auto;
  width: 80%;
}

.vertical-tab {
  color: #333;
  display: block;
  font-family: arial, sans-serif;
  margin: auto;
  position: relative;
  width: 80%;
}

.vertical-tab input[name="sections"] {
  left: -9999px;
  position: absolute;
  top: -9999px;
}

.vertical-tab section {
  display: block;
}

.vertical-tab section label {
  background: #fff;
  border-right:1px solid #ccc;
  cursor: pointer;
  display: block;
  font-size: 1.2em;
  font-weight: bold;
  padding: 15px 20px;
  position: relative;
  width: 180px;
  z-index:100;
}

.vertical-tab section article {
  display: none;
  left: 230px;
  min-width: 300px;
  padding: 0 0 0 21px;
  position: absolute;  
  top: 0;
}

.vertical-tab section article:after {
  background-color: #fff;
  bottom: 0;
  content: "";
  display: block;
  left:-229px;
  position: absolute;
  top: 0;
  width: 220px;
  z-index:1;
}

.vertical-tab input[name="sections"]:checked + label { 
  background: #fff;
  border-right:2px solid #000;
  color: #bbb;
}

.vertical-tab input[name="sections"]:checked ~ article {
  display: block;
}


@media (max-width: 533px) {

  h1 {
    width: 100%;
  }

  .vertical-tab {
    width: 100%;
  }

  .vertical-tab section label {
    font-size: 1em;
    width: 160px;
  }  

 .vertical-tab section article {
    left: 200px;
    min-width: 270px;
  } 

  .vertical-tab section article:after {
    background-color: #ccc;
    bottom: 0;
    content: "";
    display: block;
    left:-199px;
    position: absolute;
    top: 0;
    width: 200px;

  }  

}


@media (max-width: 768px) {
  h1 {
    width: 96%;
  }

  .vertical-tab {
    width: 96%;
  }
}


@media (min-width: 1366px) {
  h1 {
    width: 70%;
  }

  .vertical-tab {
    width: 70%;
  }
}
            
          
!
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.

Console