angular.js - How to use "..." to express when the text of this kind of drop-down box is too long?
PHPz2017-05-15 17:12:02
0
5
902
How to use "..." to indicate that the text in this drop-down box is too long? I tried setting it according to the second person’s answer but it didn’t work
In this way, it will become an ellipsis when the size of the parent element is exceeded. If it is useless, check whether the width of the parent element is too wide
I don’t know how to use native selection. . .
Two thoughts:
No need to use native ones
select
,自己写一个select
Well, everything is easy to control and not difficultoption
用js方法截断一下,可以根据字节长度来截断添加到select
Insidewidth: The width you want to set
overflow:hidden
text-overflow:ellipsis
white-space:nowrap
Set the width of the drop-down box and then set display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
After setting it up, it doesn’t work. I checked that the code has been set up and the effect has not changed
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
In this way, it will become an ellipsis when the size of the parent element is exceeded. If it is useless, check whether the width of the parent element is too wide