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 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

              
                
<h1>Pure CSS Accordion Menu</h1>

<div class="accordionMenu">
	<input type="radio" name="trg1" id="acc1" checked="checked">
	<label for="acc1">Quisquam dolorem eos</label>
	<div class="content">
		<div class="inner">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repudiandae dolorem autem sit accusamus quis minima voluptatibus, ex placeat corporis explicabo perspiciatis deserunt voluptate a voluptas molestiae magni eligendi natus corrupti.</div>
	</div>

	<input type="radio" name="trg1" id="acc2">
	<label for="acc2">Fugiat esse odit animi</label>
	<div class="content">
		<div class="inner">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur cupiditate libero veritatis inventore hic repellendus maiores temporibus, animi eligendi incidunt, aut, similique at. Vitae cumque, iste facilis, adipisci esse quia.</div>
	</div>

	<input type="radio" name="trg1" id="acc3">
	<label for="acc3">Quibusdam adipisci</label>
	<div class="content">
		<div class="inner">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum magnam eaque temporibus tempora ullam ducimus totam veniam voluptatibus saepe officia inventore numquam, autem repudiandae neque debitis nulla odio dolores vero.</div>
	</div>

	<input type="radio" name="trg1" id="acc4">
	<label for="acc4">Harum animi placeat</label>
	<div class="content">
		<div class="inner">Lorem ipsum dolor sit amet, consectetur adipisicing elit. A similique inventore qui atque reprehenderit repudiandae expedita voluptatum aliquam corporis, quod delectus, rerum doloribus in maiores facere quo culpa, debitis mollitia.</div>
	</div>

	<input type="radio" name="trg1" id="acc5">
	<label for="acc5">Obcaecati quibusdam conse</label>
	<div class="content">
		<div class="inner">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores nobis distinctio expedita id fuga enim accusantium error libero similique non autem quis voluptate, voluptas, porro perferendis, adipisci ipsam laudantium in!</div>
	</div>

	<input type="radio" name="trg1" id="acc6">
	<label for="acc6">Modi excepturi</label>
	<div class="content">
		<div class="inner">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis laborum modi velit eum a impedit inventore molestias repellendus illum, cum voluptatum harum quaerat sed, cumque sit officia molestiae autem voluptatibus.</div>
	</div>
</div>
              
            
!

CSS

              
                @import 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700';

body {
	background: #ECF0F1;
	font-family: 'Source Sans Pro';
	font-weight: 400;
}

h1 {
	font-size: 35px;
	color: #2C97DE;
	text-align: center;
}

.accordionMenu {
	width: 500px;
	margin:0 auto;
}
.accordionMenu input[type=radio] {
	display: none;
}
.accordionMenu label {
	display: block;
	height: 50px;
	line-height: 47px;
	padding: 0 25px 0 10px;
	background: #2C97DE;
	font-size: 18px;
	color: #FFF;
	position: relative;
	cursor: pointer;
	border-bottom: 1px solid #e6e6e6;;
}
.accordionMenu label:after {
	display: block;
	content: "";
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 5px 0 5px 10px;
	border-color: transparent transparent transparent #ffffff;
	position: absolute;
	right: 10px;
	top: 20px;
	z-index: 10;
	-webkit-transition: all 0.3s ease-in-out;
	   -moz-transition: all 0.3s ease-in-out;
	    -ms-transition: all 0.3s ease-in-out;
	     -o-transition: all 0.3s ease-in-out;
	        transition: all 0.3s ease-in-out;
}

.accordionMenu .content {
	max-height: 0;
	height: 0;
	overflow: hidden;
	 -webkit-transition: all 2s ease-in-out;
		  -moz-transition: all 2s ease-in-out;
	 	   -ms-transition: all 2s ease-in-out;
		    -o-transition: all 2s ease-in-out;
			 		 transition: all 2s ease-in-out;
	
}
.accordionMenu .content .inner {
	font-size: 1.2rem;
  color: #2C97DE;
	line-height: 1.5;
	background: white;
	padding: 20px 10px;
}

.accordionMenu input[type=radio]:checked + label:after {
	-webkit-transform: rotate(90deg);
	   -moz-transform: rotate(90deg);
	    -ms-transform: rotate(90deg);
	     -o-transform: rotate(90deg);
	        transform: rotate(90deg);
}

.accordionMenu input[type=radio]:checked + label + .content {
	max-height: 2000px;
	height: auto;
	 
}
              
            
!

JS

              
                /*
Thanks to Ugur Seker for design support
*/
              
            
!
999px

Console