For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/css/properties/text-overflow.md.
Lynx
  • 简体中文
  • text-overflow

    介绍

    text-overflow 属性用于确定如何提示用户存在隐藏的溢出内容。

    使用示例

    语法

    text-overflow: clip;
    text-overflow: ellipsis;

    取值

    • clip
      默认值。文本会在内容区域的极限处被截断。

    • ellipsis
      会使用一个省略号 ... (U+2026 HORIZONTAL ELLIPSIS) 来表示被截断的文本。这个省略号会被添加在内容区域中。因此,会减少实际显示的文本内容,为了保证省略号被完整显示,内容区域的末尾可能有少量空白。

    形式定义

    初始值clip
    适用元素text
    是否支持继承no
    是否支持动画no

    形式语法

    clip | ellipsis

    与 Web 的区别

    • 不支持 fade 模式。

    • 不支持使用 <string> 自定义截断处的显示字符。

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。