作者:渊博的大盗zhang_618 | 来源:互联网 | 2023-01-05 14:23
Ivefoundthatarticle我发现那篇文章https:justmarkup.comlog201507dealing-with-long-words-in-css
I've found that article
我发现那篇文章
https://justmarkup.com/log/2015/07/dealing-with-long-words-in-css/
and I'm wondering how to force to display a whole word if it fits to the container:
我想知道如果它适合容器,如何强制显示整个单词:
e.g.
some long sentence
it can be displayed as
它可以显示为
some long s...
the word sentence
doesn't fit so I want to hide it and show only:
单词句子不适合所以我想隐藏它并仅显示:
some long
my current css (it adds the ...
)
我目前的CSS(它增加了...)
.short {
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
4 个解决方案