0

I'm struggling to show the text ending with ellipsis when a string is too long on a HTML select element.

I've created a simple example:

<select>
    <option>Just a long long long text?</option>
</select>

and the css:

select {
  background-color: #eee;
  width: 100px;
  height: 50px;
  border: 1px dotted black;
  overflow: hidden;
  text-overflow: ellipsis;    
}

JSFiddle demo

As you can see the overflow hidden is working but not the ellipsis. Any idea?

Community
  • 1
  • 1
Bonomi
  • 2,541
  • 5
  • 39
  • 51
  • 4
    Does this answer your question? [Ellipsis for overflow text in dropdown boxes](https://stackoverflow.com/questions/7289769/ellipsis-for-overflow-text-in-dropdown-boxes) – s0xzwasd May 22 '20 at 11:07
  • 1
    Yes, I used the hack suggestion, with JavaScript – Bonomi May 22 '20 at 13:28

0 Answers0