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

2017-12-29 10:16:41 浏览数 (1)

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 人点赞