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

              
                <h1>CSS only Accordion (No JavaScript)</h1>
        <div id="wrapper">
           
            <ul>
                <li>
                    <input type="checkbox" checked>
                    <i></i>
                    <h2>What is Lorem Ipsum ?</h2>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
                </li>
                <li>
                    <input type="checkbox" checked>
                    <i></i>
                    <h2>Why do we use it ?</h2>
                    <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
                </li>
                <li>
                    <input type="checkbox" checked>
                    <i></i>
                    <h2>Wher we can it ?</h2>
                    <p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>
                </li>
            </ul>
        </div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Poiret+One);
@white:#FFFFFF;
@grayLighter : #eee;
@black : #000;
body {
	width: 100%;
	height: 100%;
  
	background-color: @grayLighter;
	font-family: 'Poiret One', cursive;
	color: rgba(48, 69, 92, 0.8);
}

#wrapper {
	min-height: 0;
	display: inline-block;
	position: relative;
	left: 50%;
	margin: 50px 0;
	transform: translate(-50%, 0);
	background-color: #fefffa;
	max-width: 450px;
	padding: 30px;
	@media ( max-width:550px ) {
		box-sizing: border-box;
		transform: translate(0, 0);
		max-width: 100%;
		min-height: 100%;
		margin: 0;
		left: 0;
	}
}
h1, h2 {
  color: @black;
}

h1 {
	margin: 10% auto 0;
	text-transform: uppercase;
	font-size: 36px;
	line-height: 42px;
	letter-spacing: 3px;
	font-weight: 100;
	text-align: center;
	display: table;
	padding: 10px 0;
	font-weight: bolder;
	border-bottom: 2px solid #000;
}
h2 {
  font-size: 26px;
  line-height: 34px;
  font-weight: 300;
  letter-spacing: 1px;
  display: block;
  background-color: #fefffa;
  margin: 0;
  cursor: pointer;
}
p {
  color: rgba(48, 69, 92, 0.8);
  font-size: 17px;
  line-height: 26px;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  max-height: 800px;
  opacity: 1;
  transform: translate(0, 0);
  margin-top: 14px;
  z-index: 2;
  transition:all 500ms ease;
}
p, ul li i:before, ul li i:after {
  transition: all 0.25s ease-in-out;
}
ul {
  list-style: none;
  padding: 0;
  margin: 0;
  & li {
		position: relative;
		padding: 0;
		margin: 0;
		padding-bottom: 4px;
		padding-top: 18px;
		border-top: 1px dotted #dce7eb;
		& i{
			position: absolute;
			transform: translate(-6px, 0);
			margin-top: 9px;
			right: 0;
			&:before,&:after {
				content: "";
				position: absolute;
				background-color: @black;
				width: 3px;
				height: 16px;
			}
			&:before {
			  transform: translate(2px, 0) rotate(45deg);
			}
			&:after {
			  transform: translate(2px, 0) rotate(-45deg);
			}
		}
		& input[type=checkbox] {
			position: absolute;
			cursor: pointer;
			width: 100%;
			height: 100%;
			z-index: 1;
			opacity: 0;
			&:checked ~ p {
				margin-top: 0;
				max-height: 0;
				opacity: 0;
				transform: translate(0, 50%);
			}
			&:checked ~ i:before {
				margin-top: 9px;
				height: 9px;
				transform: translate(2px, 0) rotate(45deg);
			}
			&:checked ~ i:after {
				margin-top: 9px;
				height: 9px;
				transform: translate(-2px, 0) rotate(-45deg);
			}
		}
	}
}

ul li:nth-of-type(1) {
	border-top:none;
  animation-delay: 0.5s;
}
ul li:nth-of-type(2) {
  animation-delay: 0.75s;
}
ul li:nth-of-type(3) {
  animation-delay: 1s;
}
ul li:last-of-type {
  padding-bottom: 0;
}
li {
  animation: bounceInUp 1s ease both;
}


@-webkit-keyframes bounceInUp { 
    0% { 
        opacity: 0; 
        -webkit-transform: translateY(2000px); 
    } 
    60% { 
        opacity: 1; 
        -webkit-transform: translateY(-30px); 
    } 
    80% { 
        -webkit-transform: translateY(10px); 
    } 
    100% { 
        -webkit-transform: translateY(0); 
    } 
} 

@keyframes bounceInUp { 
    0% { 
        opacity: 0; 
        transform: translateY(2000px); 
    } 
    60% { 
        opacity: 1; 
        transform: translateY(-30px); 
    } 
    80% { 
        transform: translateY(10px); 
    } 
    100% { 
        transform: translateY(0); 
    } 
} 




              
            
!

JS

              
                /**
*No js is required
**/
              
            
!
999px

Console