Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

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.

HTML

              
                <div id="wrapper">
  <!-- Tab List -->
	<div class="tab-list-area">
	  <ul class="list-inline">
	    <li class="tab-link active-tab" data-tab="home">
	      Home
	    </li>
	    <li class="tab-link" data-tab="content">
	      Content
	    </li>
	    <li class="tab-link" data-tab="link">
	      Link
	    </li>    
	  </ul>
	</div>

	<!-- Tab content data -->
	<div class="tab-content-area">
	  <div class="tab-content active-content" id="home">
	  	<p>
	    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatum hic, alias voluptatem laboriosam error doloribus at dolores quam harum expedita? Dolores exercitationem architecto omnis harum non iusto nostrum a suscipit excepturi laboriosam illo modi, eos aperiam cum optio animi aliquid nam vel vitae. Assumenda rerum nobis laborum perspiciatis quia eos?
	    </p>
		</div>
	 <div class="tab-content" id="content">
	      <p>
	        Lorem ipsum dolor sit, amet consectetur adipisicing elit. Explicabo non esse cum quibusdam doloremque et eius consectetur perferendis, totam, incidunt, natus porro ipsa hic quis laboriosam possimus veritatis nostrum? Quidem consectetur ducimus eum quod deleniti corrupti, iste sit vero alias saepe rerum consequatur debitis provident repellat dolor odit tempora, perspiciatis recusandae sed doloribus veritatis! Repellendus quisquam cumque mollitia sed omnis reiciendis maxime, nemo accusantium nobis consequatur ullam! Aliquid ab quisquam cum, repudiandae optio necessitatibus rem sequi possimus provident veritatis cupiditate quam soluta eaque illum molestias earum fugit doloremque nesciunt illo iusto laborum corrupti explicabo magni quas! Error consequatur necessitatibus adipisci.
	   </p>
	 </div>
	 <div class="tab-content" id="link">
	      Lorem ipsum dolor sit amet consectetur, adipisicing elit. Animi saepe veniam, dolores debitis cum molestiae quas magni accusamus, et, atque repellat. Sed magnam iusto tempore id harum error beatae vitae aperiam, neque est aspernatur quia laboriosam molestias nihil, unde inventore laborum incidunt minima recusandae? Atque, et magnam, nisi tempora repellendus dolorem fuga alias optio ducimus, corporis beatae tempore hic quae?
	 </div> 
	</div>

</div>


              
            
!

CSS

              
                #wrapper{
 max-width: 700px; 
  margin: 0 auto;
  padding: 50px;
}

.list-inline{
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid gray;
}

.list-inline > li{  
  padding: 10px;
}

.tab-list-area ul{
  overflow: hidden;
}

.tab-list-area li{
  cursor: pointer;
  float: left;
}

.active-tab{
  background-color: gray;
  color: #fff;
}

.tab-content-area .tab-content{
  padding: 25px;
  line-height: 35px;
  font-size: 25px;
  text-align: justify;
  background-color: #f1f1f1;
}

.tab-content-area .tab-content{
  display: none;
}

.active-content{
  display: block !important;
}
              
            
!

JS

              
                let tabVal;
let contentVal;
  
$(".tab-link").click(function(){
  console.log('click');
  tabVal = $(this).attr('data-tab');
  contentVal = '#'+tabVal;
  console.log(tabVal);
  console.log(tabVal);	    
  $(".tab-link").removeClass('active-tab');
  $(this).addClass('active-tab');
  $(".tab-content").removeClass("active-content");
  $(contentVal).addClass("active-content")
});
              
            
!
999px

Console