段落文本为单行并仅显示最后一个字符

问题描述 投票:-2回答:1

在我的程序中,我添加了将段落文本限制为CSS中的单行显示。

white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inherit;

但它只显示初始单词。我希望在溢出时显示段落的最后一个单词。

原文:

基于模式的写作的目的:快速简便的论文是快速,轻松地教学生如何组织信息和明确点。

电流输出:

基于模式的写作的目的:快速简便的论文是快速,轻松地教学生。

预期产出:

论文是为了快速,轻松地教学生如何组织信息和明确要点。

如何用CSS实现这一目标?

html css user-interface user-experience
1个回答
1
投票

Text-overflow ellipsis on left side重复

HTML:

<p><bdi>The purpose of Pattern Based Writing: Quick & Easy Essay is to quickly and easily teach students how to organize information and make points clear.</bdi></p>

CSS:

p {  
  white-space: nowrap;                   
  overflow: hidden;
  text-overflow: ellipsis;  
  width:550px;
  direction:rtl;
  text-align:left;
} 
© www.soinside.com 2019 - 2024. All rights reserved.