In the application we write BS, sometimes we want to display the data in the database in a table mode, but the data inside is inconsistent. For the sake of beautiful, many websites display the content in a omitted manner. I have seen a lot of websites that I first take out the same length of data, and then add the omitted number. In fact, Text-overflow in CSS can solve this problem.
grammar:
Text-overflow:
CLIP |
Ellipsis
Value:
CLIP: The default value. Do not display omitted tags (...), but simple cutting Ellipsis: When the text overflows in the object, the omitted mark is displayed (...)
Description:
Set or retrieve whether to use a omitted tag (...) overflow overflow within the object.
This attribute only acts on the horizontal inline direction, and the general Western text overflows. The inline overflows occurred in the line exceeds the available width but there is no time to come.
To force overflow to occur and apply
Ellipsis value, the author must set the object
White-space attribute value is
NOWRAP.
If there is no commission opportunity (for example, the width of the object container is narrow, there is a long time without reasonable discretion), no application
NOWRAP is also possible to overflow.
because
The Ellipsis value is applied, this property must be set to an object with an invisible area. The best choice is set
Overflow property is
Hidden. Set
Overflow property is
Scroll or
This property will also be applied when Auto. However, there will be a scroll bar.
The hidden text can be selected by selecting a omitted mark. When the choice occurs, the omitted tag is hidden and is replaced by text.
This property provides an efficient method for making omitted marks in DHTML.
This property is for
The CurrentStyle object is read-only. For other objects can be read and written.
The corresponding script feature is
Textoverflow.
Can you try it yourself, or I will also have an omitted number?