input[type="range"]是html5中的input标签新属性,样子如下:
2017-12-14 17:33
615 查看
input[type="range"]是html5中的input标签新属性,样子如下:
<input type="range" value="40" />
如果想让此滑块效果如下图所示,怎么做呢?
以下是样式部分:
<style type="text/css">
input[type="range"] {
-webkit-box-shadow: 0 1px 0 0px #424242, 0 1px 0 #060607 inset, 0px 2px 10px 0px black inset, 1px 0px 2px rgba(0, 0, 0, 0.4) inset, 0 0px 1px rgba(0, 0, 0, 0.6) inset;
margin-top: 2px;
background-color: #272728;
border-radius: 15px;
width: 400px;
-webkit-appearance: none;
height:10px;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
cursor: default;
top: -5px;
height: 30px;
width: 20px;
transform: translateY(-4px);
background: none repeat scroll 0 0 #777;
border-radius: 15px;
-webkit-box-shadow: 0 -1px 1px black inset;
}
</style>
<input type="range" value="40" />
如果想让此滑块效果如下图所示,怎么做呢?
以下是样式部分:
<style type="text/css">
input[type="range"] {
-webkit-box-shadow: 0 1px 0 0px #424242, 0 1px 0 #060607 inset, 0px 2px 10px 0px black inset, 1px 0px 2px rgba(0, 0, 0, 0.4) inset, 0 0px 1px rgba(0, 0, 0, 0.6) inset;
margin-top: 2px;
background-color: #272728;
border-radius: 15px;
width: 400px;
-webkit-appearance: none;
height:10px;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
cursor: default;
top: -5px;
height: 30px;
width: 20px;
transform: translateY(-4px);
background: none repeat scroll 0 0 #777;
border-radius: 15px;
-webkit-box-shadow: 0 -1px 1px black inset;
}
</style>
相关文章推荐
- html5 input type="range"实现拖拉滑条功能
- html5中的input(type="file")的multiple属性,实现多文件上传,并用js控制文件大小,数量
- html5实现滑块功能之------type="range"属性
- HTML中的input type="reset"标签失效(不起作用)的可能原因
- 【转】移除HTML5 input在type="number"时的上下小箭头
- <input type="image"标签引发的页面提交!
- WebView 加载H5 <Input type="file"/>标签上传图片问题
- 关于Html5中<input type="number" name="points" min="1" max="10" />只能输入整数的问题
- html input标签的type属性的使用
- HTML <input> 标签的 type 属性
- 【DOM操作】实时监听input[type='text']和HTML标签中属性改变事件
- 自定义(滑动条)input[type="range"]样式
- 移除HTML5 input在type="number"时的上下小箭头
- android支持html的<input type="file">标签
- 改HTML5里的input标签的required属性的提示为英文的
- input type="reset"标签失效
- HTML <input> 标签的 type 属性
- <input type="img"> 与 <img> 标签的区别
- 关于JFinal的单个input标签type=file的multiple="multiple"多图片上传,每次只接收到一个uploadFile对象的解决办法。
- HTML中INPUT type="date"标签如何赋值注意问题