0

I have a select box populated by some database fields. Some fields are way too long, so the option width doesn't end. I would like to limit the width, and display an ellipsis using the text-overflow property. However it does not work.

This is how I am trying to do it :

select option {
    display: block;
    text-overflow: ellipsis;
    max-width: 100px;
}

Any idea how I could achieve this without JS?

Many thanks

mc110
  • 2,825
  • 5
  • 20
  • 21
Alexandre Bourlier
  • 3,972
  • 4
  • 44
  • 76

1 Answers1

2

There is a similar question at this link. In Chrome and safari it may not be possible to show the ellipsis and you may have to put up with -webkit-appearance: none.

Ellipsis for overflow text in dropdown boxes

Community
  • 1
  • 1
j_v_wow_d
  • 511
  • 2
  • 11