Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="v-tab">
  
<ul class="v-tab_tab-head">
  <li class="active" rel="vtab1">Molestie lobortis</li>
  <li rel="vtab2">Venenatis</li>
  <li rel="vtab3">Ipsum</li>
  <li rel="vtab4">Rhoncus dolor nunc</li>
</ul>
  
<div class="v-tab_container">

  <div id="vtab1" class="v-tab_content">
    
    <h3>heading here</h3>
    <p>Lorem ipsum non pellentesque lacinia ullamcorper faucibus eu quisque, ut odio nisi aptent proin dictumst lorem tincidunt, accumsan nec habitasse arcu nisl lacus gravida odio elementum quis consectetur vehicula egestas.</p>
  </div>
  <!-- #tab1 -->

  <div id="vtab2" class="v-tab_content">
    <p>Dui sociosqu vitae varius nulla habitasse inceptos pharetra feugiat curabitur, nibh molestie est semper mattis malesuada viverra auctor, duis pulvinar quam diam scelerisque ut nullam condimentum ut per conubia feugiat ultricies tristique dictum.

</p>
  </div>
  <!-- #tab2 -->

  <div id="vtab3" class="v-tab_content">
    <p>Morbi cursus dapibus ut donec commodo consequat arcu turpis hendrerit luctus nulla aliquam tempor diam massa faucibus vitae vehicula, ultricies volutpat nullam phasellus dui auctor senectus morbi tellus potenti iaculis bibendum ipsum sodales non.

</p>
  </div>
  <!-- #tab3 -->

  <div id="vtab4" class="v-tab_content">
    <p>Per ligula mollis vulputate tortor urna platea non maecenas fames, maecenas ante senectus suspendisse ultrices aptent torquent laoreet scelerisque ut integer arcu magna ultricies mollis.

</p>
  </div>
  <!-- #tab4 --> 
</div>
</div>
</div>
              
            
!

CSS

              
                
//customise here
//specify width here

$tab__head_width: 125px;
$tab__container_width: 500px;

$border-color              :#ccc;
$border-color-active       :#94399e;
$tab-hover-bg              :#f5f5f5;
$tab-head-color            :#333;
$tab-bg                    :#e5e5e5;
$active-tab                :#94399e;

.v-tab{
  display:flex;
}
.v-tab_tab-head {
	margin: 0;
	padding: 0;
	float: left;
	list-style: none;
	height: 32px;
	width: $tab__head_width;
  li {
      // float: left;
      margin: 0 0 1px 0;
      cursor: pointer;
      padding: 0px 10%;
      height: 32px;
      line-height: 31px;
      color:$tab-head-color;
      border-bottom: 0px;
      overflow: hidden;
      position: relative;
      width:80%;
      &:hover {
        background-color: $tab-hover-bg;
        color:#000;
      }
      &.active {
        border-right:3px solid $border-color-active;
        background-color: #fff;
        color: $active-tab  ;
        display: block;
      }
    }
}
.v-tab_container {
	border-left: 1px solid $border-color;
	float: left;
	width: $tab__container_width;
   min-height:132px;
}
.v-tab_content {
	padding: 10px 20px;
	display: none;
    > :first-child {
    margin-top: 0;
    }
  }


//useless styles for demo

body{
padding:50px;
font-size:14px;
font-family: 'Open Sans', sans-serif;
}


              
            
!

JS

              
                
    $(".v-tab_content").hide();
    $(".v-tab_content:first").show();

    $(".v-tab_tab-head li").click(function() {
	
      $(".v-tab_content").hide();
      var activeTab = $(this).attr("rel"); 
      $("#"+activeTab).fadeIn();		
      $(".v-tab_tab-head li").removeClass("active");
      $(this).addClass("active");

	  
    });

	
              
            
!
999px

Console