惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
S
Securelist
P
Proofpoint News Feed
D
DataBreaches.Net
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Project Zero
Project Zero
A
About on SuperTechFans
罗磊的独立博客
WordPress大学
WordPress大学
月光博客
月光博客
Latest news
Latest news
C
Cyber Attacks, Cyber Crime and Cyber Security
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
AI
AI
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Help Net Security
Help Net Security
T
Tor Project blog
V
Vulnerabilities – Threatpost
C
Cisco Blogs
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MyScale Blog
MyScale Blog
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Forbes - Security
Forbes - Security
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
T
Threat Research - Cisco Blogs
B
Blog RSS Feed
博客园 - 叶小钗
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Simon Willison's Weblog
Simon Willison's Weblog
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic

博客园 - smile轉角

【js】ES5,ES6继承是如何实现的 【js】setTimeout、Promise、Async/Await 的区别 【面试题】思维逻辑方面 【js】js内置对象Error(错误机制) 【TS】学习笔记 【js】CommonJS、AMD、CMD三种规范 【其他】查看Animate.css官网动画没有效果 【vue3】父子组件通信之 vue3 defineProps,defineEmits ,defineExpose 【js】JS严格模式有什么特点 【css】使用弹性盒子布局时,省略号问题 【vue】 Failed to load resource: the server responded with a status of 404 (Not Found) 【第三方】富文本调研 【js】元素是否在可视区范围内 【js】json的相关操作 【vue3】资料 【css】展示背景图片的底部部分 【html】 svg 【js】forEach,for...in,for...of 区别 【js】map,reduce,filter的区别
【html5】html5中input 标签 type值为range时,修改其默认css
smile轉角 · 2022-08-12 · via 博客园 - smile轉角

demo

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        input[type="range"] {
            -webkit-appearance: none; /* 去除默认样式 */
            background: -webkit-linear-gradient(red, red) no-repeat, #dedede;
            background-size: 0 100%;
            width: 200px;
            height: 2px;
            border-radius: 15px;
            
        }
 
        /* 去除获取焦点时的边框 */
        input[type="range"]:focus {
            outline: none;
        }
 
        /* chrome自定义滑动轨道 */
        input[type="range"]::-webkit-slider-runnable-track {
            height: 2px;
            border-radius: 15px;
        }
 
        /* chrome自定义滑块 */
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            position:relative;
            top:-4px;
            width: 12px;
            height: 12px;
            border:1px solid red;
            background: #fff;
            border-radius: 50%;

        }
 
        /* firefox自定义滑动轨道 */
        input[type="range"]::-moz-range-track {
            background: #dedede;
            height: 2px;
        }
 
        /* firefox自定义滑块 */
        input[type="range"]::-moz-range-thumb {
            position:relative;
            top:-4px;
            width: 12px;
            height: 12px;
            border:1px solid red;
            background: #fff;
            border-radius: 50%;
        }
 
        /* firefox根据滑块位置填充进度条 */
        input[type="range"]::-moz-range-progress {
            height: 2px;
            background: red;
        }
 
        /* IE自定义滑动轨道 */
        input[type="range"]::-ms-track {
            height: 2px;
            border-color: transparent; /* 去掉原有边框 */
            color: transparent; /* 去掉轨道内的竖线 */
            border-radius: 15px;
            background: #dedede;
        }
 
 
        /* IE自定义滑块 */
        input[type="range"]::-ms-thumb {
            position:relative;
            top:-4px;
            width: 12px;
            height: 12px;
            border:1px solid red;
            background: #fff;
            border-radius: 50%;
        }
 
        input[type=range]::-ms-fill-lower { /*进度条已填充的部分*/
            background: red;
        }
 
        input[type=range]::-ms-fill-upper { /*进度条未填充的部分*/
            background: #dedede;
        }
    </style>
</head>
 
<body>
    <div>
        <input id="range" type="range" max="100" min="0" value="0">
    </div>
</body>
<script>
    // 谷歌通过js修改填充进度条颜色
    var range = document.getElementById("range");
    range.onmousemove = function () {
        range.style.backgroundSize = range.value + '% 100%';
    }
</script>
 
</html>

效果图