iPhone:文本溢出仅截断句子的最后一个单词

时间:2019-06-25 13:11:58

标签: html ios css responsive-design ellipsis

我在iPhone 7中遇到问题,我想用省略号截断长句子。我已经设置了用省略号截断所需的所有属性(块元素;文本溢出:省略号;溢出:隐藏;空白:nowrap;)。

它被截断了,但是只有句子的最后一个单词。到达父容器的末尾时应截断。

以下是代码的Code Pen link

.ellipsis{
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow:hidden;  
}
    <div class="ellipsis">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>

0 个答案:

没有答案