Trivia

Trivia

  • Tag
    • crontab1
    • css2
    • hexo1
    • leetcode17
    • mysql1
    • network1
    • scrapy6
    • splash1
  • Homepage
  • By Year
  • My Website
  • Github

限制文字单行显示,超出部分省略号

2016-08-15
  • css

需要三句话。

1
2
3
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

解释一下。第一句是说文字显示不换行,第二句说溢出部分隐藏,第三局说溢出时显示省略号。
所以能够实现以上功能。

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
© 2016 Trivia - Powered by Hexo - Theme Chan