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

              
                <p>
	<button type="button">Change display property</button>
</p>

<div id="wrapper">
	<div id="div1" class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic, aliquam.</div>
	<div id="div2" class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus, asperiores, vero dolorum earum sapiente dicta est iusto molestias placeat architecto. Rem neque obcaecati nostrum quae explicabo sint esse dolores quis!</div>
	<div id="div3" class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, iure ipsa dolorem iusto aliquid recusandae.</div>
</div>

              
            
!

CSS

              
                body {
	background-color: #333;
	margin:1em;
}
#wrapper {
	margin:0 auto;
}

.content {
	padding:.5em;
	float:left;
	width:33.3%;
	box-sizing: border-box;
}
.display_cell {
	display: table;
}
.display_cell>.content {
	display:table-cell;
	float:none;
}


/* styling */
#div1 {
	background-color: #defd90;
}
#div2 {
	background-color: #f7abd9;
}
#div3 {
	background-color: #9ed6f9;
}
p {
    margin-bottom:2em;
    text-align: center;
}
button {
    font-size:1.5em;
    padding:.3em;
}
              
            
!

JS

              
                document.getElementsByTagName('button')[0].onclick = function () {
	var _wrapper = document.getElementById('wrapper');
	if(_wrapper.classList.contains( 'display_cell')) {
		_wrapper.classList.remove('display_cell');
	} else {
		_wrapper.classList.add('display_cell');
	}
}
              
            
!
999px

Console