Skip to content

Instantly share code, notes, and snippets.

@zeropopular
Created September 19, 2015 01:36
Show Gist options
  • Save zeropopular/ffe73e8332e580a5f790 to your computer and use it in GitHub Desktop.
Save zeropopular/ffe73e8332e580a5f790 to your computer and use it in GitHub Desktop.
For example your dropdown looks like this and has no scrollbar
<select>
<option value="1">One</option>
<option value="2">two</option>
<option value="3">Three</option>
<option value="4">Four</option>
<option value="5">Five</option>
<option value="6">Six</option>
</select>
Put your list inside a DIV tag and set the DIV style overflow:auto and the DIV's height to a fixed height.
<div style=overflow:auto>
<option value="1">One</option>
<option value="2">two</option>
<option value="3">Three</option>
<option value="4">Four</option>
<option value="5">Five</option>
<option value="6">Six</option>
</select>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment