cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

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.

            
              <body>
<div class="tab-container">
<div class="tab-menu">
      <ul>
         <li><a href="#" class="tab-a active-a" data-id="tab1">TAB-1</a></li>
         <li><a href="#" class="tab-a" data-id="tab2">TAB-2</a></li>
         <li><a href="#" class="tab-a" data-id="tab3">TAB-3</a></li>
      </ul>
   </div><!--end of tab-menu-->
   <div  class="tab tab-active" data-id="tab1">
         <h2>heading of tab one</h2>
         <p>Content of tab one</p>
         
   </div><!--end of tab one--> 

   <div  class="tab " data-id="tab2">
          <h2>heading of tab two</h2>
         <p>Content of tab two</p>
   </div><!--end of tab two--> 
      <div  class="tab " data-id="tab3">
          <h2>heading of tab three</h2>
         <p>Content of tab three</p>     
   </div><!--end of tab three--> 
</div><!--end of container-->
</body>
            
          
!
            
              body{
	margin: 0;
	padding: 0;
	height: 100%;
	background-color: #c7eae0;
	font-family: 'sans-serif', sans-serif;
}
.tab-container{
	margin: 5% 10%;
	background-color: #c1e3d9;
	padding: 3%;
	border-radius: 4px;
}
.tab-menu{}
.tab-menu ul{
	margin: 0;
	padding: 0;
}
.tab-menu ul li{
	list-style-type: none;
	display: inline-block;
}
.tab-menu ul li a{
	text-decoration: none;
	color: rgba(0,0,0,0.4);
	background-color: #b4cbc4;
	padding: 7px 25px;
	border-radius: 4px;
}
.tab-menu ul li a.active-a{
	background-color: #588d7d;
	color: #ffffff;
}
.tab{
	display: none;
}
.tab h2{
	color: rgba(0,0,0,.7);
}
.tab p{
	color: rgba(0,0,0,0.6);
	text-align: justify;
}
.tab-active{
	display: block;
}
            
          
!
            
              $(document).ready(function(){ 
    $('.tab-a').click(function(){  
      $(".tab").removeClass('tab-active');
      $(".tab[data-id='"+$(this).attr('data-id')+"']").addClass("tab-active");
      $(".tab-a").removeClass('active-a');
      $(this).parent().find(".tab-a").addClass('active-a');
     });
});
            
          
!
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