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

              
                <!-- toggle dark mode using the top right checkbox -->

<h1>A Cat On The Internet</h1>
	
<p>
	
	<img src="https://images.unsplash.com/photo-1548247416-ec66f4900b2e?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" alt="">
	
	The domestic cat is a small, typically furry, carnivorous mammal. They are often called house cats when kept as indoor pets or simply cats when there is no need to distinguish them from other felids and felines. They are often valued by humans for companionship and for their ability to hunt vermin. There are more than seventy cat breeds recognized by various cat registries.
	
	<a href="https://en.wikipedia.org/wiki/Cat">About cats</a>
</p>

<div class="dark-mode-switch">
	<input id="dark-mode" type="checkbox" onclick="document.documentElement.classList.toggle('dark-mode')">	
	<label for="dark-mode">Dark mode</label>
</div>
              
            
!

CSS

              
                /**
 * Dark mode
 */
html.dark-mode {
	filter: invert(100%) hue-rotate(180deg);
	img {
		filter: invert(100%) hue-rotate(180deg);
	}
}

html, body {
	color: #222;
	background-color: #fff;
	height: 100%;
}


/*
 * To make things look better
 */
.dark-mode-switch {
	position: fixed;
	right: 1rem;
	top: 1rem;
	padding: .5rem 1rem;
	background-color: #ddd;
}

img {
	float: left;
	max-width: 40%;
	margin-right: 2em;
}

body {
	padding: 1em 2em;
}

p {
	max-width: 40em;
}

h1 {
	font-family: Georgia, Times, Times New Roman, serif;
}

html {
	margin: 0;
	padding: 0;
	line-height: 1.5;
}
              
            
!

JS

              
                
              
            
!
999px

Console