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

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.

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="wrapper">
	<h1>Pure CSS Tabs</h1>
	<div class="tabs cf">
		<input type="radio" name="tabs" id="tab1" checked>
		<label for="tab1">
        Description
      </label>
		<input type="radio" name="tabs" id="tab2">
		<label for="tab2">
        Features
      </label>
		<input type="radio" name="tabs" id="tab3">
		<label for="tab3">
        Delivery &amp; returns
      </label>

		<div id="tab-content1" class="tab-content">
			Lorem ipsum dolor sit amet, ne duo urbanitas eloquentiam consectetuer, vel et stet complectitur intellegebat, malorum alterum mei no. Ut alii reprehendunt cum, homero munere mentitum mei eu. At sit everti aliquid, ad nusquam voluptaria pro, ad pri quot
			aeterno constituto.
		</div>
		<div id="tab-content2" class="tab-content">
			Lorem ipsum dolor sit amet, ne duo urbanitas eloquentiam consectetuer, vel et stet complectitur intellegebat, malorum alterum mei no. Ut alii reprehendunt cum, homero munere mentitum mei eu. At sit everti aliquid, ad nusquam voluptaria pro, ad pri quot
			aeterno constituto. Phaedrum volutpat cu vix, vim cu fugit iriure iudicabit, sea dico veri ei. Detracto copiosae platonem nam id, nonumy molestie indoctum sit no. Vix paulo facete an, ne usu viris graece legendos.
		</div>
		<div id="tab-content3" class="tab-content">
			Lorem ipsum dolor sit amet, ne duo urbanitas eloquentiam consectetuer, vel et stet complectitur intellegebat, malorum alterum mei no. Ut alii reprehendunt cum, homero munere mentitum mei eu. At sit everti aliquid, ad nusquam voluptaria pro, ad pri quot
			aeterno constituto. Phaedrum volutpat cu vix, vim cu fugit iriure iudicabit, sea dico veri ei. Detracto copiosae platonem nam id, nonumy molestie indoctum sit no. Vix paulo facete an, ne usu viris graece legendos. Cum ei reque iuvaret quaerendum, no
			eum nibh omnes, ei quo doctus explicari. No mea eirmod sententiae, ornatus evertitur ex usu. Aeque accusata gubergren ad cum, vim et movet volutpat. Cum ea recteque reformidans, tantas disputando et vis, ei usu pericula facilisis. Qui meliore reprehendunt
			ne.
		</div>
	</div>


	<div class="other-content">
		<p>
			Lorem ipsum dolor sit amet, ne duo urbanitas eloquentiam consectetuer, vel et stet complectitur intellegebat.
		</p>
	</div>
</div>
              
            
!

CSS

              
                
// variables

$font-stack-sans-serif: Roboto, Helvetica, Arial, sans-serif;
$font-stack-serif: "Roboto Slab", Times, "Times New Roman", serif;
$color: #333;
$border-color: #ccc;



// mixins

@mixin box-sizing {
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}



// resets

html, body {
	font-size: 20px;
}

html {
	@include box-sizing;
}
*, *:before, *:after {
	@include box-sizing;
}

body {
	padding: 40px;
	margin: 0;
	line-height: 1.5;
	background-color: $color;
	font-family: $font-stack-sans-serif;
	color: $color;
}

h1 {
	margin-top: 0;
	line-height: 1.25;
	text-align: center;
	font-family: $font-stack-serif;
	color: white;
}

/* highlight colors */
::-moz-selection {
	background-color: #333;
	color: white;
}
::selection {
	background-color: #333;
	color: white;
}



// modules

/* wrapper */
.wrapper {
	max-width: 70ch;
	padding-right: 10px;
	padding-left: 10px;
	margin-right: auto;
	margin-left: auto;
}



// styles

/* tabs */
.tabs {
  border-right: 1px solid $border-color;
	&:after {
  	content: "";
  	display: table;
  	clear: both;
	}
	& input[type=radio] {
  	display: none;
	}
	& label {
  	display: block;
  	float: left;
  	width: 33.33333%;
  	padding: 1em;
  	border: 1px solid $border-color;
  	border-right: none;
  	background-color: #f7f7f7;
		text-align: center;
		font-weight: 700;
		color: coral;
  	cursor: pointer;
		transition: background-color 150ms ease-in-out;
		&:hover {
			background-color: white;
		}
	}
	&  [id^="tab"]:checked + label {
	  border-bottom-color: white;
	  background: white;
		color: $color;
	}
}
.tab-content {
  display: none;
  float: left;
  width: 100%;
  padding: 1em;
  border-bottom: 1px solid $border-color;
  border-left: 1px solid $border-color;
  background-color: white;
}
#tab1:checked ~ #tab-content1,
#tab2:checked ~ #tab-content2,
#tab3:checked ~ #tab-content3 {
  display: block;
}
.other-content {
	color: white;
}



// media queries

@media only screen and (max-width:768px) {	
	body, html {
		font-size: 18px;
	}
}
@media only screen and (max-width:645px) {
	.tabs label {
		float: none;
		width: 100%;
	}
}
@media only screen and (max-width:480px) {
	body, html {
		font-size: 16px;
	}
}
              
            
!

JS

              
                // j
              
            
!
999px

Console