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 id="main-wrapper">
	
	<div class="contrast-bg">
		<h1>Pure CSS Tabs</h1>
		<p>Create Tabs in Pure CSS without the needing of additional JavaScript!</p>
	</div>

	<div class="container">
		
		<div class="contrast-bg">
			
			<h2>Tab-Style 1</h2>

			<!-- First Tab-Style -->
			<div class="tabbed theme-1">

				<input id="tab1_1" type="radio" name="tabs_1" checked="checked">
				<input id="tab2_1" type="radio" name="tabs_1">
				<input id="tab3_1" type="radio" name="tabs_1">

				<nav>

					<label for="tab1_1">Settings 1</label>
					<label for="tab2_1">Settings 2</label>
					<label for="tab3_1">Settings 3</label>

				</nav>

				<figure>

					<div class="tab_form tab1" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 1</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<br/>At vero eos et accusam et justo duo dolores et ea rebum.<br/>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

					<div class="tab_form tab2" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 2</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<br/>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

					<div class="tab_form tab3" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 3</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

				</figure>

			</div>
			<!-- First Tab-Style - End -->

		</div>

		<div class="contrast-bg">

			<!-- Second Tab-Style -->
			<h2>Tab-Style 2</h2>

			<div class="tabbed theme-2">

				<input id="tab1_2" type="radio" name="tabs_2" checked="checked">
				<input id="tab2_2" type="radio" name="tabs_2">
				<input id="tab3_2" type="radio" name="tabs_2">

				<nav>

					<label for="tab1_2">1</label>
					<label for="tab2_2">2</label>
					<label for="tab3_2">3</label>

				</nav>

				<figure>

					<div class="tab_form tab1" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 1</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

					<div class="tab_form tab2" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 2</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<br/>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

					<div class="tab_form tab3" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 3</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.<br/>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

				</figure>

			</div>
			<!-- Second Tab-Style - End -->
			
		</div>
		
		<div class="contrast-bg">
			
			<h2>Tab-Style 3</h2>

			<!-- Third Tab-Style -->
			<div class="tabbed theme-3">

				<input id="tab1_3" type="radio" name="tabs_3" checked="checked">
				<input id="tab2_3" type="radio" name="tabs_3">
				<input id="tab3_3" type="radio" name="tabs_3">

				<nav>

					<label for="tab1_3">Settings 1</label>
					<label for="tab2_3">Settings 2</label>
					<label for="tab3_3">Settings 3</label>

				</nav>

				<figure>

					<div class="tab_form tab1" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 1</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<br/>At vero eos et accusam et justo duo dolores et ea rebum.<br/>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

					<div class="tab_form tab2" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 2</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<br/>At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

					<div class="tab_form tab3" data-group="integrations">

						<div class="tab_inner">
							<h4>Settings 3</h4>
							<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
						</div>

					</div>

				</figure>

			</div>
			<!-- Third Tab-Style - End -->

		</div>

	</div>
	
</div>
              
            
!

CSS

              
                /* Tabs */
.tabbed {

	position: relative;
	
	figure {

		display: block; 
		margin: 0;
		clear: both;
		z-index: 9;

		.tab_form {

			opacity: 0;
			visibility: hidden;
			
			height: 0;
			width: 100%;
			
			line-height: 1.5em;
			letter-spacing: 0.3px;
			text-align: left;
			margin: 0;
			
			.tab_inner {
				
				& > *:first-child {

					margin-top: 0;

				}
				& > *:last-child {
					margin-bottom: 0;
				}
				
			}

		}

	}

	& > input {

		display: none;

	}

	nav {

		height: auto;
		display: flex;
		flex-wrap: wrap;

		label {

			width: 25%;
			padding: 8px 20px;
			color: #fff;
			cursor: pointer;

			transition: background-color .5s;

		}

	}

}

.theme-1 {
	
	&.tabbed {

		display: flex;
		flex-wrap: wrap;

		figure {

			width: 75%;
			margin-top: 10px;

			.tab_form {

				height: 0;
				background: #fff;
				text-align: left;

				.tab_inner {

					padding: 20px;
					border: 1px solid #0096ff;

				}

			}

		}

		nav {

			width: 25%;
			height: auto;
			display: block;

			label {

				display: block;
				width: 100%;
				padding: 8px 20px;
				border: 1px solid #0096ff;
				background: rgba( 0, 150, 255, 1 );
				color: #fff;
				cursor: pointer;
				margin-bottom: 4px;
				margin-right: 4px;

				transition: background-color .5s;

				&:hover {

					background: rgba( 0, 150, 255, .5 );

				}

				&:active {

					background: #ffffff;

				}

			}

		}

	}

}

.theme-2 {
	
	&.tabbed {

		figure {
			
			padding-top: 35px;

			.tab_form {
				
				.tab_inner {

					padding: 15px;
					border: 1px solid #0096ff;
					background-color: #ffffff;
					
				}

			}

		}

		nav {
			
			position: absolute;
    		width: 100%;

			label {
				
				border: 1px solid #0096ff;
				background: rgba( 0, 150, 255, 1 );
				width: 10%;
				margin-right: 4px;

				&:hover {

					background: rgba( 0, 150, 255, .5 );

				}

				&:active {

					background: #ffffff;

				}

			}

		}

	}

}

.theme-3 {
	
	&.tabbed {

		display: flex;
		flex-wrap: wrap;

		figure {

			width: 75%;

			.tab_form {

				height: 0;
				background: #fff;
				text-align: left;

				.tab_inner {

					padding: 20px;
					border: 1px solid #0096ff;

				}

			}

		}

		nav {

			width: 25%;
			height: auto;
			display: block;

			label {

				display: block;
				width: 80%;
				padding: 8px 20px;
				color: #0096ff;
				cursor: pointer;
				
				margin-bottom: 4px;
				margin-right: 4px;
				padding-left: 30px;
				
				text-align: left;
				position: relative;

				&:before {

					content: '➤';
					
					position: absolute;
					left: -20px;
					top: 2px;

					opacity: 0;
					font-size: 24px;
					
					transition: opacity .5s, left .5s;

				}
				
				&:hover {

					&:before {
						
						opacity: 1;
						left: -8px;
						
					}

				}

				&:active {

					&:before {
						
						opacity: 1;
						left: -8px;
						
					}

				}

			}

		}

	}

}

@media (max-width: 767px) {
    
    .theme-1 {

		&.tabbed {
			
			nav {

				width: 100%;

				label {

					width: calc( 100% - 40px );
					display: block;
					float: none;
					margin: 4px 0;
					border-bottom: 1px solid #0096ff !important;

					&:after {

						display: none !important;

					}

				}

			}

			figure {

				width: 100%;

			}
			
		}

    }

    .theme-3 {

		&.tabbed {
			
			nav {
	
				width: 100%;
				
			}
			
			figure {

				width: 100%;
				margin-top: 20px;

			}
			
		}

    }

}

@for $tab from 1 through 3 {
	@for $block from 1 through 3 {

		.tabbed {

			#tab#{$tab}_#{$block}:checked ~ figure .tab#{$tab} {

				opacity: 1;
				visibility: visible;
				height: auto;

			}

		}
		
	}

	.theme-1 {

		#tab#{$tab}_1:checked ~ nav label[for='tab#{$tab}_1'] {

			background: #ffffff;
			color: #0096ff;

		}

	}

	.theme-2 {

		#tab#{$tab}_2:checked ~ nav label[for='tab#{$tab}_2'] {

			background: #ffffff;
			border-bottom-color: #ffffff;
			color: #0096ff;

		}

	}

	.theme-3 {

		#tab#{$tab}_3:checked ~ nav label[for='tab#{$tab}_3'] {

			&:before {

				opacity: 1;
				left: 0px;

			}

		}

	}
	
}
/* Tabs - End */


/* Some CSS to prettyfy the screen */
body {

	text-align: center;
	font-family: Arial, sans-serif;
	margin: 0;
	min-height: 100vh;

	position: relative;
	z-index: 1;
	overflow: hidden;
	overflow-y: auto;

	background: linear-gradient(180deg, rgba(255,146,33,1) 0%, rgba(178,17,255,1) 100%);
	background-repeat: no-repeat;

	&:after {

		content: " ";
		display: block;
		
		width: 100%;
		height: 100%;
		
		position: absolute;
		left: 0;
		top: 0;
		
		z-index: -1;
		opacity: .8;
		
		background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="28" height="49" viewBox="0 0 28 49"%3E%3Cg fill-rule="evenodd"%3E%3Cg id="hexagons" fill="%239C92AC" fill-opacity="0.4" fill-rule="nonzero"%3E%3Cpath d="M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');

	}
	
	a {
		color: #0078cc;
		text-decoration: none;
	}
	
	#main-wrapper {
		
		padding: 40px 0;
		
	}
	
	.contrast-bg {
		
		padding: 15px;
		background-color: rgba( 255, 255, 255, .6 );
		
		&:first-child {
			margin-bottom: 60px;
		}
		&:last-child {
			margin-top: 60px;
		}
		
		p {
			
			margin-top: 0;
			
		}
		
	}
	
	.container {
		
		width: 100%;
		max-width: 1200px;
		margin: 0 auto;
		display: block;
		
		.left {
			text-align: left;
			width: 25%;
			margin: 0 15px;
		}
		.right {
			text-align: left;
			width: 75%;
			margin: 0 15px;
		}
		
	}

}
@media ( max-width: 767px ) {
	
	body .container {
		display: block;
	}
	body .container .left,
	body .container .right {
		margin: 15px;
		width: calc( 100% - 60px );
	}
	
}
              
            
!

JS

              
                
              
            
!
999px

Console