English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
text-The overflow CSS property determines when the text container overflows to be visible (instead of hidden)overflowHow to display text content when the block container element of
The following table provides usage descriptions and version histories of this property, as well as the syntax of its usage in JavaScript scripts.
Default value: | clip |
---|---|
Applies to: | Block-level container |
Inheritance: | None |
Animated by: | No.See also Animation properties. |
Version: | CSS3new feature |
JavaScript syntax: | object.style.textOverflow="ellipsis" |
Note:For example, if the element is set to nowrap and the whitespace or single word is too long to fit, the text may overflow, resulting in text overflow.
The syntax of this attribute is as follows:
text-overflow: clip | ellipsis | string | initial | inherit
The following example demonstrates how to use text-overflow attribute.
p { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }Test see‹/›
The table below describes the value of this attribute.
Value | Description |
---|---|
clip | Truncation is suitable for text content. Characters may only be partially rendered. |
ellipsis | Use the ellipsis character ('...') to replace the truncated text. |
string | Use the given string to represent the truncated text. This string is displayed in the content area, thus shortening the size of the displayed text. If there is not enough space to display the string, it will be truncated. |
initial | Set this property to its default value. |
inherit | If specified, the associated element adopts its parent element text-Overflow property values. |
text-Browser compatibility of overflow attribute, the numbers in the table below represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.
|
Note: Internet Explorer supports-ms-text-overflow can be used as a synonym in the prefixed version text-overflow. Opera 9and10Supports prefixed versions-o-text-overflow.
Please refer to the tutorials related to the following content:CSS OverflowandCSS Text.
Properties related to text:letter-spacing,text-align,text-decoration,text-indent,text-shadow,text-transform,white-space,word-spacing.