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 because the default value of table-layout is auto, that is, the width and height of a table
One, single-line text overflow display ellipsis (... ) )Set the width and height of the block elements, and then use three properties (integral) to controlOverflow:hidden;Text-overflow:ellipsis;White-space:nowrap;The Demo is as follows:The effect is as follows:Two, multi-line text overflow display ellipsis (... )You can use the following four properties to control:Overflow:hidden;Text-overflow:ellipsis;Disp
]; - //Dispose of any resources the can be recreated. - } - - #pragmaMark-private Methods in- (void) touchesended: (Nsset *) touches withevent: (Uievent *)Event { - StaticNsuinteger i =1; to Switch(i%6) { + Case 0: -_lblmessage.linebreakmode = Nslinebreakbytruncatingtail;//truncated trailing ellipsis mode; default value the_lblmessage.text =@"Nslinebreakbytruncatingtail;something can try to do."; * Break; $
Overflow of single-line text displays ellipses (...)Text-overflow:ellipsis;3 White-space:nowrap;However, this property does not support multiple lines of text overflow display ellipsis, here according to the application scenario describes several methods.WebKit a browser or mobile pageIn WebKit browser or mobile (most of the WebKit kernel browser) page implementation is relatively simple, you can directly use the WebKit CSS extension properties (WebKi
We should all know how to use
text-overflow:ellipsisproperty to implement a single-line text overflow display ellipsis (...). Of course, some browsers also need to add width
widthProperty.
CSS code:
Overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
However, this property does not support multiple lines of text overflow display ellipsis, here according to the application scenario introduc
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;
CSS3 Gradient are divided into linear gradients (linear) and radial gradients (radial). Because different rendering engines implement the syntax of gradients, we only analyze the use of the standard syntax for linear gradients, and the rest of us can read the relevant data. The ie10+, firefox19.0+, chrome26.0+ and opera12.1+ have been supported by browsers.
In this section, let's take a look at the linear gradient:
Parameters:
First parameter: Specifies the gradient direction, which can be ex
The following small series for everyone to bring the CSS text beyond the specified width after hiding and display as an ellipsis implementation of the sample code. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
Generic truncation of text (for inline and block):
. text-overflow { display:block;/* inline objects need to be added */ width:25em; word-
When a page text is too lengthy, not only not conducive to the user's visual feelings, but also not conducive to the optimization of the site. So how do we use the CSS out of the partial display ellipsis instead? This article will give you a detailed description of the CSS beyond the partial display ellipsis how to implement it? Hope to have the help of friends who need!
CSS out-of-section display
Label: Text-overflow ellipsis 1. Use the text-overflow style attribute value ellipsis in the DIV label: Ii. Method of Using text-overflow style attribute value ellipsis in Table tag sub-tag TD Tag: Note: The example in Code 2 fails to achieve the desired effect in some browsers (such as operabrowser. How to use the text-overflow style attribute value
CSS control text beyond the specified width is replaced with ellipses, CSS control text does not wrap. Generic truncation of text (for inline and block):. text-overflow {display:block;/* inline objects need to be added */Width:31em;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 te
In the previous article the small div layout card stack (card-stacking) has multiple lines of text overflow ellipsis effect, this article on the effect (including single-line text overflow omitted) Implementation of a simple record, in case you forget. Specifically, it is to achieve this text arrangement effect.The HTML code is as follows:1 Divclass= "Container">2 Divclass= "box">3 Divclass= "Box-content">4 h5class= "Box-content-title">Com
width:100%;//need to specify widthoverflow:hidden;//overflow HiddenText-overflow:ellipsis;white-space:nowrap;//Force No Line breakText-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 definitions are
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
Can I use the ellipsis (...) in the excess parts in javascript? Are there any plug-ins? For example, in this demo, jsfiddle. netkanjiushipg7c78qe only wants to keep one line. If the line is exceeded, it is omitted without line breaks. In addition, php omitted. What is the name of the function? Is it possible to use the ellipsis (...) in the excess part in javascript? Are there any plug-ins?
Like this demo,
In the mobile device viewer, if the text length of a field exceeds web. config (
Local_drive: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ layouts \ mobile Directory), WSS will display the ellipsis. The mobile list item editing form contains a large amount of data. WSS disables the field editing function based on the field type to avoid data loss due to content exceeding the specified limit. In either ca
In the mobile device viewer, if the text length of a field exceeds the web size. in config (located in the Local_Drive: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ LAYOUTS \ MOBILE Directory), WSS displays a ellipsis. The mobile list item editing form contains a large amount of data. WSS disables the field editing function based on the field type to avoid data loss due to content exceeding the specified
Ellipsize is mainly when the TextView text is too long, we can let it display the ellipsisUse the following:in XMLellipsis at the end -android:ellipsize = "End"ellipsis at the beginning -android:ellipsize = "Start"ellipsis in the middle -android:ellipsize = "Middle"Racing Lights -android:ellipsize = "marquee"It's best to add a constraint line display -android:singleline = "true"You can also set the maximum
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.