scss 将文本截断为一行,将鼠标悬停以展开

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss 将文本截断为一行,将鼠标悬停以展开相关的知识,希望对你有一定的参考价值。

span {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: Xpx; // width or max-width must be specified in an absolute unit; relative units will not work.
    word-wrap: normal; // 
 
    &:hover {
      white-space: normal;
    }
    // on a touch device, a click is equivalent to hover - text will expand and remain that way
  }

以上是关于scss 将文本截断为一行,将鼠标悬停以展开的主要内容,如果未能解决你的问题,请参考以下文章