Firefox 7正式支持 text-overflow: ellipsis终于赶上IE6的脚步

Summary

The text-overflow CSS property determines whether an ellipsis (“…”) displays when text content has overflowed its given layout area. To force overflow to occur and ellipses to be applied, the author must apply some additional properties on the element. See example below.

Syntax

text-overflow: ellipsis | clip

Values

ellipsis

Display ellipses … (U+2026, …) to represent clipped text.

clip

Default value, clips text.

  1. p {
  2. white-space: nowrap;
  3. width: 100%; /* IE6 needs any width */
  4. overflow: hidden; /* "overflow" value must be different from "visible" */
  5. -o-text-overflow: ellipsis; /* Opera 9-10 */
  6. text-overflow: ellipsis; /* IE, WebKit (Safari, Chrome), Firefox 7, Opera 11 */
  7. }

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区