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

              
                <div class="wrapper">
	<div class="container">
		<div class="element">
			<p>SASS Example</p>
			<svg width="400" height="250" viewBox="0 0 400 250">
				<rect x="0" y="0" width="400" height="250" fill="#eeeeee" />
				<text transform="translate(50, 50)" font-size="16" font-family="Arial">Ahh, I resize just in time...</text>
			</svg>
		</div>
	</div>
</div>
              
            
!

CSS

              
                =viewport($property, $initialsize, $maxwidth, $unit:vw)
	#{$property}: ($initialsize*100)/$maxwidth#{$unit}

.wrapper
	width: 100%
	height: 100%
	font-family: Arial

.container
	max-width: 1000px
	width: 90%

.element
	width: 50%
	background-color: #cccccc
	padding: 20px

p
	text-align: center
	font-size: 24px

svg 
	width: 100%

@media only screen and (max-width: 910px)
	p 
		+viewport(font-size, 24, 910)

	svg
		+viewport(width, 400, 910)
		+viewport(height, 250, 910)
              
            
!

JS

              
                // For a Medium post
// 
              
            
!
999px

Console