html5滚动条选择,HTML5 烟灰色的范围选择滑动条

CSS

语言:

CSSSCSS

确定

html {

background: #e6e6e6;

}

input[type='range'] {

box-sizing: border-box;

position: absolute;

top: 33%;

left: 50%;

padding: 0 0.25em;

width: 16em;

height: 1.5em;

border-radius: 0.75em;

/* set a background, white by default in Blink */

transform: translate(-50%, -50%);

/* make font-size consistent across browsers */

background: linear-gradient(#ccc, #fff) border-box;

font-size: 1em;

/* slider components */

/* slider variations */

/* slider states */

cursor: pointer;

}

input[type='range'],

input[type='range']::-webkit-slider-runnable-track,

input[type='range']::-webkit-slider-thumb {

-webkit-appearance: none;

}

input[type='range']::-webkit-slider-runnable-track {

/*

* set a border,

* solid 1px black by default in IE,

* no border in othr browsers

*/

box-sizing: border-box;

border: solid 1px #818181;

height: 0.875em;

border-radius: 0.4375em;

background: linear-gradient(#b0b0b0, #d5d5d5);

}

input[type='range']::-moz-range-track {

/*

* set a border,

* solid 1px black by default in IE,

* no border in othr browsers

*/

box-sizing: border-box;

border: solid 1px #818181;

height: 0.875em;

border-radius: 0.4375em;

background: linear-gradient(#b0b0b0, #d5d5d5);

}

input[type='range']::-ms-track {

/*

* set a border,

* solid 1px black by default in IE,

* no border in othr browsers

*/

box-sizing: border-box;

border: solid 1px #818181;

height: 0.875em;

border-radius: 0.4375em;

/* remove tick marks on track */

background: linear-gradient(#b0b0b0, #d5d5d5);

color: transparent;

}

input[type='range']::-webkit-slider-thumb {

margin-top: -0.0625em;

/*

* set a border,

* defaults different in every browser

*/

box-sizing: border-box;

border: solid 1px #818181;

width: 1.5em;

/*

* set a border-radius,

* rounded by default only in Firefox

*/

height: 1em;

border-radius: 0.25em;

/*

* set a background,

* defaults different in every browser

*/

box-shadow: inset 0 0.125em 0.125em #fcfcfc;

/* won't work in IE, kinda messsed in Chrome */

background: linear-gradient(#e0e0e0, #cecece);

cursor: ew-resize;

}

input[type='range']::-moz-range-thumb {

/*

* set a border,

* defaults different in every browser

*/

box-sizing: border-box;

border: solid 1px #818181;

width: 1.5em;

/*

* set a border-radius,

* rounded by default only in Firefox

*/

height: 1em;

border-radius: 0.25em;

/*

* set a background,

* defaults different in every browser

*/

box-shadow: inset 0 0.125em 0.125em #fcfcfc;

/* won't work in IE, kinda messsed in Chrome */

background: linear-gradient(#e0e0e0, #cecece);

cursor: ew-resize;

}

input[type='range']::-ms-thumb {

/*

* set a border,

* defaults different in every browser

*/

box-sizing: border-box;

border: solid 1px #818181;

width: 1.5em;

/*

* set a border-radius,

* rounded by default only in Firefox

*/

height: 1em;

border-radius: 0.25em;

/*

* set a background,

* defaults different in every browser

*/

box-shadow: inset 0 0.125em 0.125em #fcfcfc;

/* won't work in IE, kinda messsed in Chrome */

background: linear-gradient(#e0e0e0, #cecece);

cursor: ew-resize;

}

input[type='range']::-ms-fill-lower,

input[type='range']::-ms-fill-upper,

input[type='range']::-ms-tooltip {

display: none;

}

input[type='range']:nth-of-type(2) {

top: 66%;

}

.js input[type='range']:nth-of-type(2)::-webkit-slider-runnable-track {

background: linear-gradient(#fafafa, #bbb) no-repeat, linear-gradient(#b0b0b0, #d5d5d5);

background-size: 40% 100%, 100% 100%;

}

.js input[type='range']:nth-of-type(2)::-moz-range-track {

background: linear-gradient(#fafafa, #bbb) no-repeat, linear-gradient(#b0b0b0, #d5d5d5);

background-size: 40% 100%, 100% 100%;

}

.js input[type='range']:nth-of-type(2)::-ms-fill-lower {

display: block;

border-radius: 0.875em;

background: linear-gradient(#fafafa, #bbb);

}

input[type='range']:nth-of-type(2)::-webkit-slider-thumb {

margin-top: -0.1875em;

height: 1.25em;

background: repeating-linear-gradient(90deg, #bbb, #bbb 1px, rgba(187, 187, 187, 0) 2px, rgba(187, 187, 187, 0) 4px) no-repeat 50% 50%, linear-gradient(#ededed, #c9c9c9);

background-size: 65% 65%, 100% 100%;

}

input[type='range']:nth-of-type(2)::-moz-range-thumb {

height: 1.25em;

background: repeating-linear-gradient(90deg, #bbb, #bbb 1px, rgba(187, 187, 187, 0) 2px, rgba(187, 187, 187, 0) 4px) no-repeat 50% 50%, linear-gradient(#ededed, #c9c9c9);

background-size: 65% 65%, 100% 100%;

}

input[type='range']:nth-of-type(2)::-ms-thumb {

height: 1.25em;

background: repeating-linear-gradient(90deg, #bbb, #bbb 1px, rgba(187, 187, 187, 0) 2px, rgba(187, 187, 187, 0) 4px) no-repeat 50% 50%, linear-gradient(#ededed, #c9c9c9);

background-size: 65% 65%, 100% 100%;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值