<div class="slider">
  <label id="slider-label" class="slider-label isRight"></label>
  <input id="slider-input" class="slider-input" type="range" min="0" value="0" max="100">
</div>
/* Number slider ------------------- */

.slider {
    position: relative;
    display: inline-block;
    margin: -4px 6px 0 0;
}


/* Label ------------------- */

.slider-label {
    position: absolute;
    z-index: 1;
    top: 4px;
    font-size: 11px;
    color: hsla(0,0%,0%,0);
    pointer-events: none;
    transition: transform .2s cubic-bezier(.26,.08,.15,1), color .6s .6s ease-out;
}

.slider-label.isRight {
    right: 50%;
    margin-right: -20px;
    left: auto;
    transform: translateX(20px);
}
.slider-label.isLeft {
    right: auto;
    margin-left: -20px;
    left: 50%;
    transform: translate(-20px);
}

.slider:active .slider-label {
    color: hsla(0,0%,0%,.7);
    transition-delay: 0;
}


/* Input ------------------- */

.slider-input {
    appearance: none;
    position: relative;
    vertical-align: middle;
    width: 100px;
    border-radius: 20px;
    background: hsl(0,0%,80%);
    box-shadow: 0 1px 0 hsla(0,0%,100%,.6);
    overflow: hidden;
}

.slider-input::-webkit-slider-thumb,
.slider-input::slider-thumb {
    appearance: none;
    border-radius: 20px;
    width: 20px;
    height: 20px;
    border: 5px solid hsl(0,0%,80%);
    cursor: pointer;
    background: hsl(0,0%,40%);
    box-shadow: inset 0 1px 2px hsla(0,0%,0%,.4);
    transition: border-width .2s cubic-bezier(.26, .08, .15, 1);
}

.slider-input:active::-webkit-slider-thumb,
.slider-input:active::slider-thumb {
    border: 0px solid hsl(0,0%,80%);
    transition-duration: .1;
}



body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-box-align: center;
  -webkit-box-pack: center;
  display: flex;
  flex-direction: column;
  flex-orient: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 50px;
  box-sizing: border-box;
  background: hsl(0,0%,90%);
}
html {
 height: 100%; 
}
var labelSide = "right";

$('#slider-input').change( function() {
    var val = $(this).val();
    var valRounded = Math.round( val * 10 ) / 10;
    var mid = $(this).attr('max')/2;
  
    $('#slider-label').text( valRounded );
  
    if(val > mid && labelSide == "right") {
        labelSide = "left";
        $('#slider-label').removeClass("isRight").addClass("isLeft");
    
    } else if(val <= mid && labelSide == "left") {
        labelSide = "right";
        $('#slider-label').removeClass("isLeft").addClass("isRight");
    }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js