Skip to content

Instantly share code, notes, and snippets.

@juanbrujo
Last active August 19, 2020 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanbrujo/3b093a22007ce7fa5bf32a70e0f43431 to your computer and use it in GitHub Desktop.
Save juanbrujo/3b093a22007ce7fa5bf32a70e0f43431 to your computer and use it in GitHub Desktop.
HTML native select attribute that holds the dropdown with scroll if needed by viewport
<!-- test: https://jsbin.com/renixijogu/1/edit?html,css,output -->
<select size="number">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>8</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
</select>
select {
margin-top: 80vh;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment