Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <h1>CSS toggle feature</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi voluptatibus saepe, velit minima aut voluptas iure facilis repudiandae iusto. Aspernatur.</p>
<div class="toggle">
	<input type="checkbox" value="selected" id="someID" class="toggle__input">
    <label for="someID" class="toggle__label">show me <span class="toggle__more">more</span><span class="toggle__less">less</span> stuff
    <div class="toggle__content">
		<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reiciendis sequi quidem officia quis, repellendus voluptas voluptatibus in adipisci magnam consectetur, reprehenderit laborum ducimus ipsum dolores dicta vero. Laudantium inventore, reprehenderit!</p>


                body {
	font-family: "Helvetic Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
h1 {
	font-weight: bold;
	color: #191919;
p {
	margin-bottom: 0.7em;
	margin-top: 0;
.toggle {
	display: flex;
	flex-direction: column-reverse;
.toggle__input:not(checked) {
    display: none;
.toggle__input + label {	
	background-color: #D65D5D;
	border-radius: 5px; 
	color: #fff;
	cursor: pointer;
	font-szie: 0.8em;
	margin-top: 0.5em;
	margin-bototm: 0.5em;
	padding: 0.5em;
	text-align: center;
	width: 12em;
.toggle__input + label:before {
	color: #fff;
	content: "+";
	font-size: 1em;
	padding-right: 0.3em;
	width: 1em;
.toggle__input:not(checked) ~ .toggle__content {
    display: none;
.toggle__input:checked ~ .toggle__content {       
    display: block;
.toggle__input:checked + label:before {
  content: "\2212";
.toggle__input + label .toggle__less, .toggle__input:checked + label .toggle__more  {
    display: none;
.toggle__input:checked + label .toggle__less {
    display: inline;