search

Home  >  Q&A  >  body text

angular.js - 这种下拉框文字过长时如何用“...”表示呢?

这种下拉框文字过长时如何用“...”表示呢?按第二个人回答的设置了一下不管用

PHPzPHPz2743 days ago867

reply all(5)I'll reply

  • 黄舟

    黄舟2017-05-15 17:14:02

    I don’t know how to use native selection. . .

    Two thoughts:

    1. No need to use native onesselect,自己写一个selectWell, everything is easy to control and not difficult

    2. option用js方法截断一下,可以根据字节长度来截断添加到selectInside

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-15 17:14:02

    width: The width you want to set
    overflow:hidden
    text-overflow:ellipsis
    white-space:nowrap

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-15 17:14:02

    Set the width of the drop-down box and then set display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;

    reply
    0
  • ringa_lee

    ringa_lee2017-05-15 17:14:02

    After setting it up, it doesn’t work. I checked that the code has been set up and the effect has not changed

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-15 17:14:02

    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

    reply
    0
  • Cancelreply