avernet
avernet

Reputation: 31753

Is it possible for select lists in HTML to have a horizontal scrollbar?

If you have an HTML <select multiple> of a certain width and height (set in CSS), if there are more values then you can possibly fit in that height, then the browser adds a vertical scroll bar. Now if the text is longer than the available width, is it possible to instruct the browser to add a horizontal scrollbar?

Upvotes: 1

Views: 2161

Answers (2)

Luke Schafer
Luke Schafer

Reputation: 9265

Not that I'm aware of.

If you'd like, put the list in a div of your desired width, and set the following style on the div:

overflow-x: scroll

This will cause the div to add a horizontal scroll bar when the select is too wide

Upvotes: 1

SLaks
SLaks

Reputation: 887405

No; you'll need to emulate the list yourself.

Upvotes: 1

Related Questions