JSFiddle - React, Tailwind, and code Playground

Bootstrap Range Sliders

by Jennifer Perrin

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.0/css/bootstrap.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">
<h1><i class="fa fa-sliders fa-rotate-90"></i> Bootstrap/CSS Range Sliders</h1>

<div class="range range-primary">
    <input type="range" name="range1" min="0" max="100" value="0" onchange="rangePrimary.value=value" />
    <output id="rangePrimary">0</output>
</div>
<div class="range range-info">
    <input type="range" name="range2" min="0" max="100" value="20" onchange="rangeInfo.value=value" />
    <output id="rangeInfo">20</output>
</div>
<div class="range range-success">
    <input type="range" name="range3" min="0" max="100" value="100" onchange="rangeSuccess.value=value" />
    <output id="rangeSuccess">100</output>
</div>
<div class="range range-warning">
    <input type="range" name="range4" min="0" max="100" value="75" onchange="rangeWarning.value=value" />
    <output id="rangeWarning">75</output>
</div>
<div class="range range-danger">
    <input type="range" name="range5" min="0" max="100" value="50" onchange="rangeDanger.value=value" />
    <output id="rangeDanger">50</output>
</div>
<div class="range range">
    <input type="range" name="range6" min="0" max="100" value="90" onchange="range.value=value" />
    <output id="range">90</output>
</div>

CSS

@import url(http://fonts.googleapis.com/css?family=Dosis);
 body {
    padding: 1.5% 20%;
    font-family:'Dosis';
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjZmZmIj48L3JlY3Q+CjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNjY2MiPjwvcmVjdD4KPC9zdmc+");
}
* { border-radius: 0 !important; }

h1 {
    margin-bottom: 30px;
    color: #4679bd;
    font-weight: 400;
    text-align: center;
}
    h1 i { margin-right: 6px; }

p {
    margin-bottom: 20px;
    color: #999999;
    font-size: 18px;
}

.range {
    display: table;
    position: relative;
    height: 25px;
    margin-top: 20px;
    cursor: pointer;
}
.range input[type="range"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -ms-appearance: none !important;
    -o-appearance: none !important;
    appearance: none !important;
    display: table-cell;
    cursor: pointer;
}
.range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -ms-appearance: none !important;
    -o-appearance: none !important;
    appearance: none !important;
    width: 11px;
    height: 25px;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}
.range input[type="range"]::-moz-slider-thumb {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -ms-appearance: none !important;
    -o-appearance: none !important;
    appearance: none !important;
    width: 11px;
    height: 25px;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}
.range output {
    display: table-cell;
    padding: 3px 5px 2px;
    min-width: 40px;
    color:#fff;
    background-color: rgb(153, 153, 153);
    text-align: center;
    text-decoration: none;
    width: 1%;
    white-space: nowrap;
    -webkit-user-select: none;
   ...

JavaScript

// Bootstrap v3.1.0
// Font Awesome 4.1.0