3

I'm trying to create a price range, by using two range elements like this:

CSS code:

.first{
    position : relative;
    top :10px;
    left :10px;
    margin : 0;
    padding : 0;
    border : 1px solid red;
    border-top : 4px solid transparent;
    border-radius :3px;
    z-index:0;
}

.next{
    position : relative;
    top :0px;
    left :-153px; 
    margin : 0;
    padding : 0;
    border : 1px solid red;
    border-bottom : 1px solid transparent;
    border-radius :3px;
    z-index : 4;
}

HTML code:

<span>price :</span>
<input class ="first" type="range" min="0" max="10000" step="100" value="0" multiple>
<input class ="next" type="range" min="0" max="10000" step="100" value="10000" multiple>

Is it possible to style a theme to look like a jQuery range slider?

stealthyninja
  • 10,343
  • 11
  • 51
  • 59
Ali Tenni
  • 190
  • 2
  • 11

1 Answers1

0

CSS CODE :

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-ms-track {
    width: 100%;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: 1px solid #d3d3d3;
    height: 16px;
    width: 16px;
    border-radius: 3px;
    background: #e6e6e6;
    cursor: pointer;
    margin-top: -3px;
}

input[type=range]::-webkit-slider-thumb:hover {
    background: #DADADA;
    border: 1px solid #999999;
}

input[type=range]::-moz-range-thumb {
    -moz-appearance: none;
    border: 1px solid #d3d3d3;
    height: 16px;
    width: 16px;
    border-radius: 3px;
    background: #e6e6e6;
    cursor: pointer;
}

input[type=range]::-ms-thumb {
    border: 1px solid #d3d3d3;
    height: 16px;
    width: 16px;
    border-radius: 3px;
    background: #e6e6e6;
    cursor: pointer;
}

input[type=range]::-ms-thumb:hover {
    background: #DADADA;
    border: 1px solid #999999;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #FFF;
    border-radius: 5px;
    border: 1px solid #010101;
}

input[type=range]:focus::-webkit-slider-runnable-track {
    background: #FFF;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #FFF;
    border-radius: 5px;
    border: 1px solid #aaaaaa;
}

input[type=range]::-ms-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    border-width: 16px 0;
    color: transparent;
}

input[type=range]::-ms-fill-lower {
    background: #2a6495;
    border: 1px solid #aaaaaa;
    border-radius: 2.6px;
}

input[type=range]:focus::-ms-fill-lower {
    background: #FFF;
}

input[type=range]::-ms-fill-upper {
    background: #FFF;
    border: 1px solid #aaaaaa;
    border-radius: 5px;
}

input[type=range]:focus::-ms-fill-upper {
    background: #FFF;
}
Soumya
  • 310
  • 1
  • 8
  • i want to style a range input to have two thumb to use it for price range filter. – Ali Tenni Feb 17 '15 at 11:01
  • You can tweak a bit for positioning another slider. You asked about exact looking slider as Jquery and the above CSS does exactly that. – Soumya Feb 17 '15 at 11:06