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>Track's <code>border-box</code> perfectly fits within slider's <code>content-box</code>. Thumb moves within the limits of the <code>input</code> element's <code>content-box</code> in Firefox and Edge and within the limits of the track's <code>content-box</code> in Chrome.</p>
<input type='range' value='0'/>
<p>Track's <code>border-box</code> is set to be longer than slider's <code>content-box</code> (Chrome doesn't allow this and Edge cuts it off). Thumb still moves within the limits of the <code>input</code> element's <code>content-box</code> in Firefox and Edge, even though the track width is now different.</p>
<input type='range' value='0'/>
<p>Track's <code>border-box</code> is set to be shorter than slider's <code>content-box</code> (Chrome doesn't allow this). Thumb still moves within the limits of the <code>input</code> element's <code>content-box</code> in Firefox and Edge, even though the track width is now different.</p>
<input type='range' value='0'/>
<p>Track is scaled horizontally to be longer than slider (Edge cuts it off). In Edge, the thumb now moves within an interval the size of the track's <code>border-box</code>, but starting from the left <code>padding</code> limit.</p>
<input type='range' value='0'/>
<p>Track is scaled horizontally to be shorter than slider. In Edge, the thumb now moves within an interval the size of the track's <code>border-box</code>, but starting from the left <code>padding</code> limit.</p>
<input type='range' value='0'/>
<p>The track gets a negative lateral <code>margin</code>. Thumb still moves within the limits of the <code>input</code> element's <code>content-box</code> in Firefox, even though the track is now longer.</p>
<input type='range' value='0'/>
<p>The track gets a positive lateral <code>margin</code>. Thumb still moves within the limits of the <code>input</code> element's <code>content-box</code> in Firefox, even though the track is now shorter.</p>
<input type='range' value='0'/>
              
            
!

CSS

              
                @mixin highlight-boxes($c: #f90) {
	box-sizing: border-box;
	border: solid .5em currentcolor;
	padding: .5em;
	background: currentcolor content-box;
	color: rgba($c, .65);
}

@mixin track() {
	height: 3em;
	@include highlight-boxes(#b53)
}

@mixin track-long {
	width: 35em;
}

@mixin track-short {
	width: 15em;
}

@mixin track-scaleup {
	transform: scaleX(2)
}

@mixin track-scaledw {
	transform: scaleX(.5)
}

@mixin track-marg-out {
	margin: 0 -5em
}

@mixin track-marg-inn {
	margin: 0 5em
}

@mixin thumb() {
	width: 4.5em; height: 4.5em;
	border-radius: 0;
	@include highlight-boxes(#95a)
}

p {
	font: 1em/1.65 trebuchet ms, tahoma, sans-serif;
}

code {
	display: inline-block;
	padding: 2px .25em;
	border-radius: 3px;
	background: #ddd;
	font: 1em consolas, monaco, monospace
}

input {
	&, &::-webkit-slider-thumb {
		-webkit-appearance: none
	}
	
	margin: .25em auto;
	display: block;
	width: 25em; height: 5em;
	@include highlight-boxes;
	font: 1em arial sans-serif;
	
	&::-webkit-slider-runnable-track {
		@include track()
	}
	&::-moz-range-track {
		@include track()
	}
	&::-ms-track {
		@include track()
	}
	
	&::-webkit-slider-thumb {
		margin-top: -1.75em;
		@include thumb()
	}
	&::-moz-range-thumb {
		@include thumb()
	}
	&::-ms-thumb {
		margin-top: 0;
		@include thumb()
	}
	
	&:nth-of-type(2) {
		&::-webkit-slider-runnable-track {
			@include track-long()
		}
		&::-moz-range-track {
			@include track-long()
		}
		&::-ms-track {
			@include track-long()
		}
	}
	
	&:nth-of-type(3) {
		&::-webkit-slider-runnable-track {
			@include track-short()
		}
		&::-moz-range-track {
			@include track-short()
		}
		&::-ms-track {
			@include track-short()
		}
	}
	
	&:nth-of-type(4) {
		&::-webkit-slider-runnable-track {
			@include track-scaleup()
		}
		&::-moz-range-track {
			@include track-scaleup()
		}
		&::-ms-track {
			@include track-scaleup()
		}
	}
	
	&:nth-of-type(5) {
		&::-webkit-slider-runnable-track {
			@include track-scaledw()
		}
		&::-moz-range-track {
			@include track-scaledw()
		}
		&::-ms-track {
			@include track-scaledw()
		}
	}
	
	&:nth-of-type(6) {
		&::-webkit-slider-runnable-track {
			@include track-marg-out()
		}
		&::-moz-range-track {
			@include track-marg-out()
		}
		&::-ms-track {
			@include track-marg-out()
		}
	}
	
	&:nth-of-type(7) {
		&::-webkit-slider-runnable-track {
			@include track-marg-inn()
		}
		&::-moz-range-track {
			@include track-marg-inn()
		}
		&::-ms-track {
			@include track-marg-inn()
		}
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console