Home > Software design >  How to prevent HTML option to stretch over?
How to prevent HTML option to stretch over?

Time:04-28

How can I prevent long text in select - option to stretch over the the parent div?

enter image description here

CodePudding user response:

This should be possible with the max-width CSS property:

select {
    max-width: 100%;
}

CodePudding user response:

Setting a max-width property might do the trick. You can also try the text-overflow property to hide part of the text inside the dropdown.

  • Related