Pen Settings



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


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


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.


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.


                <div class="tabbed-content clearfix">
		<!--Tabbed navigation-->
    <ul class="tabs">
      <li class="tab-link current" data-tab="text-tab">Text</li>
			<li class="tab-link" data-tab="video-tab">Video</li>
			<li class="tab-link" data-tab="audio-tab">Audio</li>
	<!--Wrapper to contain interchanging content-->
	<div class="tabs-wrapper">
		<!--textual tab content-->
		<div id="text-tab" class="tab-content current">
			<h2>Heading for tab link one</h2>
			<p>Text to go here blah blah blah</p>
		<!--video tab content-->
		<div id="video-tab" class="tab-content">
			<iframe src="" frameborder="0" allowfullscreen></iframe>
		<!--audio tab content-->
		<div id="audio-tab" class="tab-content">
			<audio src="" controls preload></audio>


                //wrapping element
.tabbed-content {
	position: relative;
	margin: 25px 0;
	overflow: hidden;
	font-family: arial, 'sans-serif';
	color: #525252;

//tab links block
	margin: 0;
	padding: 0;
	list-style: none;
	float: left;
	line-height: normal;

//individual tab link
.tab-link {
	text-transform: uppercase;
	font-size: 2em;
	color: #fff;
	display: block;
	padding: 15px 25px; 
	margin-bottom: 10px;   
	background: #525252;
	cursor: pointer;
	-webkit-border-radius: 10px 0 0 10px;
	-moz-border-radius: 10px 0 0 10px;
	border-radius: 10px 0 0 10px;
	&.current {
		background: #CCCCCC;
    color: #5B5B5B;

//tab content wrapper
.tabs-wrapper {
	float: left;

//tab content blocks to toggle between
	display: none;
	border:4px solid #CCCCCC;
	padding: 20px;
	float: left;
	-webkit-border-radius: 0 10px 10px 10px;
	-moz-border-radius: 0 10px 10px 10px;
	border-radius: 0 10px 10px 10px;
	min-height: 231px;//height of tabs + 10
	width: 100%;
	position: relative;
	&.current {
		display: inherit;
	*:first-child {

@media only screen and (max-width: 650px) {
	.tabs {
		width: 100%;
		float: none;
	.tab-link {
		float: left;
		margin-right: 10px;
		margin-bottom: 0;
		-webkit-border-radius: 10px 10px 0 0;
		-moz-border-radius: 10px 10px 0 0;
		border-radius: 10px 10px 0 0;
	.tabs-wrapper {
		width: 100%;
	.tab-content {
		min-height: 0;


                var tabbedContent = function() {
		//get all tab link elements
		var tab = document.getElementsByClassName("tab-link");
		//get all tab content elements
		var tabContent = document.getElementsByClassName("tab-content");
		//loop through each tab
		for (var i = 0; i < tab.length; i++) {
				//add click event listener to all tab links
				tab[i].addEventListener('click', function() {
						//each time tab clicked remove all current classes
						//remove 'current' class from all tabs
						for (var i = 0; i < tab.length; i++) {
						//remove 'current' class from all tab content
						for (var i = 0; i < tabContent.length; i++) {
						//add current class back to the clicked tab
						this.className += ' current';
						//get data-tab attribute of what has been clicked
						var matchingTab = this.getAttribute('data-tab');
						//add current class to the tabContent element thats id matches the data-tab of the clicked tab
						document.getElementById(matchingTab).className += ' current';
				}, false);