leonidas's avatar

Select Bootstrap 4 CSS Option on single line when selected

I have a select with long option text. At the moment this appears in the select squashed with two lines when this is selected. Adding:

white-space: nowrap;

makes the option appear on one line, however adds extra width to the page. I have tried adding:

text-overflow: ellipsis;
overflow: hidden;
max-width: 100%;

but to no avail. The select is a regular form-control in a bootstrap card. How can I make the option text appear on one line without adding the extra width?

0 likes
2 replies
leonidas's avatar
leonidas
OP
Best Answer
Level 2

I haven't added to much from the Laravel template, but I fixed this my adding to the css:

#app{
    overflow: hidden;
}

(this is the main container) and adding

white-space:nowrap;

as usual to the select css.

Please or to participate in this conversation.