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="container">

	<ul class="tabs">
		<li class="tab current" data-tab="tab-1">Tab One</li>
		<li class="tab" data-tab="tab-2">Tab Two</li>
		<li class="tab" data-tab="tab-3">Tab Three</li>
		<li class="tab" data-tab="tab-4">Tab Four</li>
	</ul>

	<div id="tab-1" class="tab-content current">
    	<h2>Tab One</h2>
		<p>Content</p>
	</div>
    
	<div id="tab-2" class="tab-content">
    	<h2>Tab Two</h2>  
		<p>Content</p>
	</div>
    
	<div id="tab-3" class="tab-content">
    	<h2>Tab Three</h2> 
		<p>Content</p>
	</div>
    
	<div id="tab-4" class="tab-content">
    	<h2>Tab Four</h2> 
		<p>Content</p>
	</div>

</div><!-- container -->
              
            
!

CSS

              
                /* CSS Document */
html {
	background: #1D1F20;
}

body {
	font-family: Tahoma,Verdana,Segoe,sans-serif;
	line-height:1.3;
	}

a {
  font-size:24px;
}

h1 {
	font-size: 50px;
	text-align: center;
}	

.container{
	width: 90%;
	margin: 20px auto;
}

.tabs{
	margin: 0px;
	padding: 0px;
	list-style: none;
	background:#666666;
	border-bottom: 5px #DF4910 solid;
}

.tabs li{
	display: inline-block;
	margin:0;
	padding: 10px 20px 5px 20px;
	cursor: pointer;
		
	font-size:1.2em;
	line-height:2em;
	color:#FFF;
}

.tabs li:hover {
	background:#DF4910;
	}

.tabs li.current{
	background: #DF4910;
	color: #FFF;
}

.tab-content{
	display: none;
	background: #323432;
	color: #cccccc;
	padding: 15px;
			
	line-height:1.4;
}

.tab-content.current{
	display: inherit;
}
              
            
!

JS

              
                $(document).ready(function(){
	
	$('ul.tabs li').click(function(){
		var tab_id = $(this).attr('data-tab');

		$('ul.tabs li').removeClass('current');
		$('.tab-content').removeClass('current');

		$(this).addClass('current');
		$("#"+tab_id).addClass('current');
	})

})
              
            
!
999px

Console