Text out of the partial display ellipsis or more commonly used an effect, recently saw some online methods to practice a bit, found that some of the previous browsers can not be used by the properties are now available, and then studied some, now summarized as follows: Let's look at the HTML code first:
CSS code:div{ width:200px;} span{ Display:block; width:200px; Overflow:hidden; White-space:nowrap; Text-overflow:ell
In the past few days, the company's Intranet has a lot of processing on the homepage to intercept strings. Currently, at my level, only functions in the jstl expression are used to intercept strings, the code with excessive truncation length omitted is as follows:
$ {Fn: substring (STR, 0, length)}
Disadvantages of the above Code: 1. It is too rigid. If the number of words is greater than the length, only the string with the length is displayed. As a result, if the letter (the letter is narrowe
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
CSS controls text to display ellipsis beyond the specified width and text without line breaks-roucheng common text truncation (for inline and block ):
. Text-overflow {display: block;/* The Inline object must be added with */width: 31em;/* Ask hovertree.com */word-break: keep-all; /* Do not wrap */white-space: nowrap;/* Do not wrap */overflow: hidden;/* Hide content beyond the width */text-overflow: ellipsis
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 tex
1. Gradient ColorCSS3 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 , whi
JQuery plugin-jquery.dotdotdot/*firfox the number of rows displayed for this effect by JS is determined by the height of the text container */ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum have been the industry ' s standard dummy text ever since the 1500s, when an unknown printer took a galley of Typ E and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essential
First, add a little bit to the previous article.The previous article was called "Force span does not wrap." At that time just realized the function, did not know its why. Recently learned a little page production knowledge, the principle has a bit of understanding. For single-line text, the implementation overflow does not wrap and the ellipsis indicates that it can be fully implemented through CSS, the code is as follows:/* handles whitespace charact
"Single-line text overflow display ellipsis (...)text-overflow:ellipsis-----Some browsers also need to add width width properties.Overflow:hidden;text-overflow:ellipsis;white-space:nowrap;Multiple lines of text overflow display ellipsisWebKit a browser or mobile pagepage implementations in WebKit browser or mobile (mostly WebKit kernel browsers) are simple and can be directly used with WebKit CSS extension properties (WebKit is a private property) -we
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 example,
Font-style: The font style italic no
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://www.CodeHighlighter.com/-->* {Margin: 0; paddi
Ellipsis in IE can be used text-overflow:ellipsis, but a lot of browsers need to be fixed width, while FF these browsers do not support text-overflow:ellipsis settings, Here are a few tutorials for you to sort out the compatible browsers that show ellipses.
You should all know that using the Text-overflow:ellipsis property to implement a single line of text overflow displays ellipses (...). Of course, some browsers also need to add width widths proper
css| Control | show
Generally we see such as news list, in order to make the text does not return to the line, control the number of words, through the program so that superfluous characters show ellipsis, we only use CSS can achieve the same effect, although not perfect.
Li {width:50px;White-space:nowrap;Text-overflow:ellipsis;Overflow:hidden;}
First is a container, can be div,li,td, and so on, first define the width, "white-space:nowrap" is forced
All browsers currently supporttext-overflow:ellipsisThis attribute is used to display the ellipsis in a single line of text. However, this attribute does not support multiple lines of text. Is there a way to achieve the same effect on multiple texts?-WebKit-line-clamp
WebKit supports-webkit-line-clampIt is actually a WebKit-specific unsupported property, that is to say, this property is not a part of the standard, may be used inside WebKit, or is disc
By default, it seems that there is no ellipsis, but it is hidden and $ page is returned as a string type variable. there is no way to control it at the front end. I want to pass parameters in the background, and then the front-end paging plug-in will process it. Www. cnblogs. comleanhu... if the page is directly returned in the background, the front-end will not do it...
It seems that there is no ellipsis
Everyone should know that using text-overflow:ellipsis attributes to implement an overflow of single-line text displays an ellipsis (...). Of course, some browsers also need to add width width properties.
Overflow: hidden;
Text-overflow: ellipsis;
White-space: nowrap;
However, this property does not support multiple lines of text overflow display
Text-overflow: ellipsis is a great choice. On win, we all know that IE and Opera can be done. Will you be excited if you look at the following code?Text-overflow: ellipsis;-O-text-overflow: ellipsis;-Icab-text-overflow: ellipsis;-Khtml-text-overflow: ellipsis;-Moz-text-overf
Add the following HTML code by using the Text-overflow and White-space properties to make the text appear in one line, beyond the ellipsis:CSS: Need to add width (width:100px), out of hiding (overflow:hidden;), force to display on the same line (white-space:nowrap;), ellipsis (text-overflow:ellipsis;)P {width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}Test Explorer: IE6/7/8/9,
As we all know, text overflow display ellipsis with CSS can be:Single-line text:White-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;Multiple lines of text:Overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;If you want to show the ellipsis in the middle??Now the demand is that a text is very long, but the last one keyword is very im
Today's browsers support the Text-overflow:ellipsis property, which is used to implement a single line of text overflow display ellipsis, but this property does not support multiple lines of text. So is there a way to achieve the same effect on multiple lines of text?-webkit-line-clamp
WebKit supports a property called-webkit-line-clamp, which is actually a webkit-specific unsupported property, which means that this attribute is not part of the standa
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.