Home | Top | Website design | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Sets or retrieves a value that indicates whether to render ellipses(...) to indicate text overflow.
Syntax
{ text-overflow : iTextOverflow } |
object.style.textOverflow ( v ) [ = iTextOverflow ] |
Possible Values
iTextOverflow | Variant that specifies or receives a value that indicates whether ellipses(...) display when text content has overflowed its given layout area.
|
The property is read/write for all objects except the following, for which it is read-only: currentStyle . The property has a default value of clip . The Cascading Style Sheets (CSS) attribute is not inherited.
Remarks
This property only applies to text overflow in the inline direction (horizontal, in normal Western text). Inline overflow occurs when the text in a line overflows the available width without a breaking opportunity. To force overflow to occur and ellipses to be applied, the author must apply the nowrap value to the whiteSpace property on the element, or wrap the content in a <NOBR> tag. If there is no breaking opportunity (for example, the width is narrow or there is a long word that does not break well), then overflow may occur without nowrap being applied.
This property on the element must be set to something other than visible , the default, in order for ellipses to be rendered. The best choice is to set overflow to hidden . Setting overflow to scroll or auto will also work, but will show scrollbars.
The hidden text can be selected by selecting the ellipses. When selected, the ellipses will disappear and be replaced by the text to the extent of the layout area.
This property offers an efficient alternative to building ellipses in Dynamic HTML (DHTML). As ellipses may be rendered many times on a single page, using this property can significantly speed up performance.
Example
The following example shows how to use both ellipsis and clip values for the textOverflow property. It also demonstrates how the effect of textOverflow can be cancelled out by setting the overflow to visible .
<HTML>
Standards Information
This property is a Microsoft extension to Cascading Style Sheets (CSS) .
Applies To
|
defaults , A , ACRONYM , ADDRESS , BDO , BIG , BLOCKQUOTE , BODY , BUTTON , CAPTION , CENTER , CITE , CODE , CUSTOM , currentStyle , DD , DEL , DFN , DIR , DIV , DL , DT , EM , FIELDSET , FONT , FORM , hn , I , INPUT type=button , INPUT type=checkbox , INPUT type=file , INPUT type=image , INPUT type=password , INPUT type=radio , INPUT type=reset , INPUT type=submit , INPUT type=text , INS , ISINDEX , KBD , LABEL , LEGEND , LI , LISTING , MARQUEE , MENU , NOBR , OL , P , PLAINTEXT , PRE , Q , RT , RUBY , runtimeStyle , S , SAMP , SMALL , SPAN , STRIKE , STRONG , style , SUB , SUP , TEXTAREA , TT , U , UL , VAR , XMP |
Home | Top | Website design | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |