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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              .range-slider

	span from
		input(type='number', value='25000', min='0', max='120000')
		|	to
		input(type='number', value='50000', min='0', max='120000')
	
	input(value='25000', min='0', max='120000', step='500', type='range')
	input(value='50000', min='0', max='120000', step='500', type='range')

	svg(width='100%', height='24')
		line(x1='4', y1='0', x2='300', y2='0', stroke='#444', stroke-width='12', stroke-dasharray='1 28')

            
          
!

CSS

            
              body
	display flex
	height 100vh

input
	box-shadow 0
	outline 0


.range-slider
	//tpl
	width 300px
	margin auto
	text-align center
	
	position relative
	height 6em
	
	svg
	input[type=range]
		position absolute
		left 0
		bottom 0

	
input[type=number]
	//width 33%
	border 1px solid #DDD
	text-align center
	font-size 1.6em
	-moz-appearance: textfield
	&::-webkit-outer-spin-button,
	&::-webkit-inner-spin-button
		-webkit-appearance none
	&:invalid
	&:out-of-range
		border 2px solid tomato


input[type=range]
	-webkit-appearance none
	width 100%

input[type=range]:focus
	outline none
	&::-webkit-slider-runnable-track
		background #2497E3
	&::-ms-fill-lower
		background #2497E3
	&::-ms-fill-upper
		background #2497E3

		
track()
	width 100%
	height 5px
	cursor pointer
	animate 0.2s

styl_track()
	background #2497E3
	border-radius 1px
	box-shadow none
	border 0

thumb()
	z-index 2
	position relative
	box-shadow 0px 0px 0px #000
	border 1px solid #2497E3
	height 18px
	width 18px
	border-radius 25px
	background #A1D0FF
	cursor pointer

input[type=range]::-webkit-slider-runnable-track
	track()
	styl_track()
input[type=range]::-webkit-slider-thumb
	thumb()
	-webkit-appearance none
	margin-top -7px

input[type=range]::-moz-range-track
	track()
	styl_track()

input[type=range]::-moz-range-thumb
	thumb()

input[type=range]::-ms-track
	track()
	background transparent
	border-color transparent
	color transparent
input[type=range]::-ms-fill-lower
input[type=range]::-ms-fill-upper
	styl_track()
input[type=range]::-ms-thumb
	thumb()

            
          
!

JS

            
              (function() {

  var parent = document.querySelector(".range-slider");
  if(!parent) return;

  var
    rangeS = parent.querySelectorAll("input[type=range]"),
    numberS = parent.querySelectorAll("input[type=number]");

  rangeS.forEach(function(el) {
    el.oninput = function() {
      var slide1 = parseFloat(rangeS[0].value),
        	slide2 = parseFloat(rangeS[1].value);

      if (slide1 > slide2) {
				[slide1, slide2] = [slide2, slide1];
        // var tmp = slide2;
        // slide2 = slide1;
        // slide1 = tmp;
      }

      numberS[0].value = slide1;
      numberS[1].value = slide2;
    }
  });

  numberS.forEach(function(el) {
    el.oninput = function() {
			var number1 = parseFloat(numberS[0].value),
					number2 = parseFloat(numberS[1].value);
			
      if (number1 > number2) {
        var tmp = number1;
        numberS[0].value = number2;
        numberS[1].value = tmp;
      }

      rangeS[0].value = number1;
      rangeS[1].value = number2;

    }
  });

})();
            
          
!
999px

Console