The currently accepted answer only truncates the text with an ellipsis and adds a border that does not completely solve the problem.
I feel this is a more complete, more cross-browser compatible answer: Do the text in the element's wrap element get too long?
In short, you can either do it right using javascript, or do it in a simple ... incompatible way using the css white-space: pre-wrap property for your option elements.
Note: if you use white-space: pre-wrap , be sure to add the browser prefixes -moz- and -o- .
Here is what I came up with as a quick, simple CSS solution (although the jQuery I talked about is more reliable and better):
select { width: 200px; max-width: 100%; } option { -moz-white-space:pre-wrap; -o-white-space:pre-wrap; white-space:pre-wrap; overflow: hidden; text-overflow:ellipsis; border-bottom: 1px solid #DDD; }
Nathan blair
source share