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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <form action="">
	<div class="accordion">
		<div class="item">
			<input type="checkbox" name="test">
			<div class="title">
				<i class="fa fa-caret-right"></i>
				Section 1
			</div>
			<div class="content">
				Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
			</div>

		</div>
		<div class="item">
			<input type="checkbox" name="test">
			<div class="title">
				<i class="fa fa-caret-right"></i>
				Section 2
			</div>
			<div class="content">
				Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
			</div>
		</div>
		<div class="item">
			<input type="checkbox" name="test">
			<div class="title">
				<i class="fa fa-caret-right"></i>
				Section 3
			</div>
			<div class="content">
				Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
			</div>
		</div>
		<button type="reset">COLLAPSE ALL</button>
	</div>
</form>
              
            
!

CSS

              
                * {
	padding: 0;
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-sizing: border-box;
}

.accordion {
	width: 600px;
	margin: 25px auto;
	button {
		width: 100%;
		border: none;
		height: 40px;
		line-height: 40px;
		background: green;
		border-radius: 3px;
		color: #fff;
		font-size: 14px;
		cursor: pointer;
	}
	.item {
		position: relative;
		margin-bottom: 15px;
		border: 1px solid #ddd;
		border-radius: 3px;
		&:last-child {
			margin-bottom: 0;
		}
		.title {
			height: 40px;
			border-radius: 3px;
			display: flex;
			align-items: center;
			padding: 0 15px;
			font-size: 14px;
			font-weight: 500;
			i {
				margin-right: 10px;
				transition: 400ms all;
			}
		}
		.content {
			border-radius: 0 0 3px 3px;
			max-height: 0;
			overflow: hidden;
			padding: 0 15px;
			line-height: 130%;
			font-size: 14px;
			transition: 400ms all;
		}
		input {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 40px;
			opacity: 0;
			cursor: pointer;
			&:checked + .title {
				background: #eee;
				border-radius: 3px 3px 0 0;
				border-bottom: 1px solid #ddd;
				i {
					transform: rotate(90deg);
				}
				& + .content {
					max-height: 700px;
					padding: 15px;
				}
			}
		}
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console