Generic truncation of text (for inline and block):. text-overflow {display:block;/* inline objects need to be added */Width:25em;word-break:keep-all;/* does not change the line */white-space:nowrap;/* does not change the line */overflow:hidden;/* content is hidden when content is out of width */text-overflow:ellipsis;/* display ellipsis (...) when text inside an object overflows; use with Overflow:hidden; */}For the definition of a table literal overf
If the implementation of a single line of text overflow display ellipsis students should know to use the Text-overflow:ellipsis attribute, of course, also need to add width of the genus to be compatible with some of the browsing.Implementation method:Overflow:hidden;text-overflow:ellipsis;white-space:nowrap;EffectBut this property only supports a single line of text overflow display ellipsis, if we want to
If the implementation of a single line of text overflow display ellipsis students should know to use the Text-overflow:ellipsis attribute, of course, also need to add width of the genus to be compatible with some of the browsing.Implementation method:Overflow: hidden; Text-overflow:ellipsis; White-space: nowrap; EffectBut this property only supports a single line of text overflow display ellipsis
Tags: class two amp text idt ellipsis splay add noFirst, there are two scenarios in which the analysis goes beyond the content, and the single-line content exceeds and the multiline content is exceeded, as described below: Single-line content operations: Single-line operations must have a width property, that is, the element must have a width and height limit can be, with the above basic conditions, write the following code Overflow:hidden; Text-o
If the implementation of a single line of text overflow display ellipsis students should know to use the Text-overflow:ellipsis attribute, of course, also need to add width of the genus to be compatible with some of the browsing.
Implementation method:
Overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
Effect
But this property only supports a single line of text overflow display ellipsis, if we wan
Common CSS font attributes (more text hidden, or displayed in the form of ellipsis), background styles, and two uncommon attributes of the background image: background-origin and background-clip,
(1) Common font attributes:
Font-weight: attribute value 100-900 400 equals normal 700 equals bold. The larger the value, the thicker the value.
Font-size: font size, in px or %
Font-family: font family, for
CSS compatible with browsers controls the character width ellipsis, which is very practical. Because FF does not support the attribute that overflow displays ellipsis. Therefore, during encoding, a private attribute of hack and FF is applied. Pay attention to the difference during learning.
Code highlighting produced by Actipro CodeHighlighter (freeware)http://w
after the completion of the DOM, so that the entire rendering process will be exposed to the user, experience is relatively bad.
Based on the above considerations, I have adopted a third approach, but I have to consider the problem of Cross-browser. Curiously, in terms of Word interception, Firefox lags behind other browsers, and it doesn't support text-overflow:ellipsis! Google a bit, incredibly foreign cattle people, with Firefox itself unique XUL markup Language for this hack, more perfect
Article transferred from here http://blog.0755hqr.com/post-597.htmlPS: Because in the place do not see the reprint button, copy the next to save here for their own convenience, others can see help is more willing to, the effect of pro-test can be achieved, compatible with IE, Google, FirefoxDue to the uncertainty of the length of the text content, and the layout accuracy of the page, if the text content beyond the limited area (Div,span, etc.), the page will deform. In order to satisfy the layou
Text-overflow Syntax:Text-overflow:clip | EllipsisText-overflow parameter values and explanations:Clip: Do not display the ellipsis tag (...). ), but a simple cutEllipsis: Displays ellipsis (...) when text inside an object overflows. )Text-overflow Application Notes:CSS Text-overflow Sets or retrieves whether an ellipsis tag (...) is used. ) indicates the overflo
) appears.I see a lot of people on the Internet that opera does not support Text-overflow, perhaps because I use the latest version of the property has been supported, so there is no way to test, but online to support the lower version of operaOne way, is-o-text-overflow:ellipsis; As for Firefox, there are many people say that do not support, the version of the problem can not be verified, we have tried to testify,Here is a "how to use CSS in Firefox
This is an example, in fact we only need to display the following length:
CSS implementation of the page text too long interception ...
The title class should write this:
. title{width:300px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
Description
1, the width must be set, can be adjusted according to the actual needs.
2, White-space:nowrap is prohibited text folding line.
3. Text-overflow Indicates whether an
First, the use of CSS implementation
1 . SLH {2width:200px; 3 Display:block; 4 Overflow:hidden; 5 white-space:nowrap; 6 -o-text-overflow:ellipsis; 7 text-overflow:ellipsis; 8 }
Pros: Easy to useCons: If you setThe ie8+ is truncated directly to the width of the width. The ellipsis is not displayed.And if the height is not specified. The text is also wrapped in a line display.So
Html + CSS: Hide the text beyond the length and display the ellipsis,
Table:
Table {Table-layout: fixed;}}TTd {White-space: nowrap;Overflow: hidden;Text-overflow: ellipsis;}}
This method is used to solve the problem of the appearance of too many table cells, mainly involving four CSS styles:1. table-layout: fixed be
Title words beyond the scene:
The left side of the column I can't let him change the line, how to do?
Step One: hide content beyond the width
Step two: show ellipsis (...) when text overflows inside an object
Here is the workaround:
table{width:100px;table-layout:fixed;/* only the table-defined layout algorithm is fixed, the following TD definition will work. */}td{width:100%;word-break:keep-all;/* does not break the line */white-space:nowrap;
good.Again see multiline text overflow omitted:1 . Multiline {2 display:-webkit-box; 3 text-overflow:ellipsis;; 4 -webkit-box-orient:vertical; 5 -webkit-line-clamp:4; 6 }You can see the use of the nonstandard CSS notation, that is, the wording with the WebKit prefix (webkit kernel browser private property), there is a number of outdated wording,Display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;There is not much to explain (i
CSS automatic line feed, force line break, force line break, excessive display ellipsis
P labels are automatically wrapped by default. Therefore, setting the width can achieve better results. However, recently, after loading data using ajax, the content in the p label does not have a line break, leading to layout disorder. So I tried to use the line feed style. Although the problem was solved, I did not fin
Sometimes, in order to avoid the page of a div content too much, and cause page distortion, we usually define Overflow:hidden in CSS, so that will not display text, but it seems that the user experience is not very good, in order to get the best user experience, we hide the text at the same time, You can display ellipses behind text, and there are ready-made methods in CSS that you can use, such as the foll
CSS Properties White-spaceTest Explorer: IE6/7/8/9, opera12.02, firefox15.0.1, chrome21.0.1180.89 m1, text-overflow:ellipsis;The main style here is text-overflow:ellipsis;However, Text-ellipsis is a special style, the explanation is this: the Text-overflow property is only annotations, and if the text overflows, the ellipsis is displayed. No other style attribute
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.