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

              
                <div class="container">
	<span>Solid</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>Plain old regular buttons</span>
</div>

<div class="container outline">
	<span>Outline</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>But if you just add a border to the outline class, the buttons get too big (even with box-sizing)</span>
</div>

<div class="container solid-with-border">
	<span>Solid With Border</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>The fix? Add the border to the solid version as well, and adjust the padding if you want</span>
</div>

<div class="container final">
	<span>Final</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>Now, put it together with your <code>:hover</code> effect and you are good to go!</span>
</div>

<div class="container final extra-credit">
	<span>Extra Credit</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>Transitions are an advanced technique that can create some visual interest (these fade and change color, for example)</span>
</div>
              
            
!

CSS

              
                .btn {
	text-decoration: none;
	color: #fff;
	background: mediumseagreen;
	font-weight: bold;
	display: inline-block;
	padding: 10px 15px;
	border-radius: 8px;
}

.outline .btn {
	color: mediumseagreen;
	border: 3px solid mediumseagreen;
	background: transparent;
}

.solid-with-border .btn {
	border: 3px solid mediumseagreen;
	padding: 7px 12px; // Padding decreased to make room for the border
}

.final .btn {
	border: 3px solid mediumseagreen;
	background-color: mediumseagreen;
	padding: 7px 12px;
}

.final .btn:hover {
	background-color: transparent;
	color: mediumseagreen;
}

.extra-credit .btn {
	transition: all 0.2s ease-in-out;
}

.extra-credit .btn:hover {
	border-color: yellowgreen;
	color: yellowgreen;
	
}

// This just creates better spacing

.container {
	margin: 20px;
}

.btn + .btn {
	margin-left: 5px;
}

.container span {
	min-width: 200px;
	display: inline-block;
	margin: 0 10px;
}

.container span:first-of-type {
	font-weight: bold;
	text-align: right;
}
              
            
!

JS

              
                
              
            
!
999px

Console