html - css not working for range input slider -
i want display range input slider in "vertical".
i use code display vertical -webkit-appearance: slider-vertical displays slider css not working showing ordinary inputrange slider.
can me how .
this code
<html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;"/> <title>how style html5 range input css</title> <style type="text/css" media="screen"> body { font-family: helvetica, sans-serif; margin: 0; padding: 10px; } input[type='range'] { -webkit-appearance: slider-vertical !important; -webkit-border-radius: 10px; -webkit-box-shadow: inset 0 0 5px #333; background-color: #157dec; display: block; height: 15px; left: 10px; margin: -100px 0 0 100px; position: absolute; right: 10px; } input[type='range']::-webkit-slider-thumb { -webkit-appearance: none !important; -webkit-border-radius: 10px; background-color: #ffffff; background-image: -webkit-gradient(circular, left top, left bottom, from(##ffffff), to(#aaa)); border: 1px solid #999; height: 33px; width: 33px; } #range { display: block; font-size: 200%; font-weight: bold; margin: -58px -12px 107px 4px ; text-align: center; } p { position: absolute; bottom: 0; left: 10px; font-size: 10px; right: 10px; text-align: center; } </style> </head> <body> <div id="wrapper"> <span id="range">0</span> <input type=range name=salary min="0" max="5" value="0" step="1" onchange="showvalue(this.value)" /> </div> <script type="text/javascript"> function showvalue(newvalue) { document.getelementbyid("range").innerhtml=newvalue; } </script> </body> </html>
don't of height in css. forcing fixed dimension.
here suggestion style
body { font-family: helvetica, sans-serif; margin: 0; padding: 10px; overflow:hidden; } input[type='range'] { -webkit-appearance: slider-vertical;/*comment see result*/ -webkit-border-radius: 10px; -webkit-box-shadow: inset 0 0 5px #333; background-color: #157dec; display: block; /*height: 15px;*/ left: 10px; /*margin: -100px 0 0 100px;*/ /*position: absolute;*/ right: 10px; margin-top:50px; } input[type='range']::-webkit-slider-thumb { -webkit-appearance: none !important; -webkit-border-radius: 10px; background-color: #ffffff; background-image: -webkit-gradient(circular, left top, left bottom, from(##ffffff), to(#aaa)); border: 1px solid #999; /* height: 33px;*/ width: 33px; } #range { display: block; font-size: 200%; font-weight: bold; margin: -58px -12px 107px 4px ; text-align: center; } p { position: absolute; bottom: 0; left: 10px; font-size: 10px; right: 10px; text-align: center; } a here preview on fiddle: http://jsfiddle.net/qxzlt/
Comments
Post a Comment