Stan Stan - 4 months ago 37
CSS Question

Hide vertical scrollbar in <select> element

Hello I have select box with multiple choices and I need to hide the vertical scrollbar, is it possible?

<select name="sCat" multiple="true">
<!-- My Option Here -->
</select>


Okey, but how then I can achieve an effect where I can select item from list that has ID and then use jQuery to manage this id.click functions? What element I should use then?

Answer

This is where we appreciate all the power of CSS3

<style>
 .bloc { display:inline-block; vertical-align:top; overflow:hidden; border:solid grey 1px; }
 .bloc select { padding:10px; margin:-5px -20px -5px -5px; }
</style>

<!-- Années -->
<div class="bloc">
  <select name="year" size="5">
    <option value="2010" >2010</option>
    <option value="2011" >2011</option>
    <option value="2012" SELECTED>2012</option>
    <option value="2013" >2013</option>
    <option value="2014" >2014</option>
   </select>
</div>

Fiddle