Divstyle= "width:100px; overflow:hidden; text-overflow:ellipsis">nobr>Show ellipsis when text inside an object overflowsnobr>Div>Syntax: text-overflow:clip | ellipsis parameter: clip: Do not show ellipsis (...) ), but a simple cut (clip This parameter is not used!) Ellipsis: Displays an
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
This article mainly introduces the implementation of the CSS implementation of single-line, multiple lines of text overflow display ellipsis, has a certain reference value, and now share to everyone, the need for friends can refer to
If you implement a single line of text overflow display ellipsis students should know to use the Text-overflow:ellipsis property,
next line. originally from: Http://caibaojian.com/css-white-space.htmlexample : Allow long words to wrap to the next line:{word-wrap:break-word;}Possible values:
value
Description
Normal
Line breaks only on allowed hyphenation points (the browser keeps the default processing).
Break-word
Wraps a line inside a long word or URL address.
1. (IE) consecutive English characters and Ar
White-space PropertyThe White-space property sets how to handle whitespace within an element.This property declares how to handle whitespace in elements during layout creation. The values Pre-wrap and Pre-line are new in CSS 2.1.
Default value:
Normal
Inheritance:
Yes
Version:
CSS1
JavaScript Syntax:
object. style.whitespace= "Pre"
Text-decoration Definition an
solve the problem without regard to compatibility, the topic of unrestrained, think of what to say, if there is a problem you feel the unusual CSSProperty
, hurry up and cram it.
Constantly updated, constantly updated, constantly updated, important things to say three times.
5, single-line center display text, multi-row left display, up to two lines more than the end of the ellipsis
That's a bad question, my brother.
The topic is the above requireme
If you want to have a container (div or Li or ... Block-level elements) display a line of text, when the text content is too large, do not wrap, but appear ..., you can use the Text-overflow:clip|ellipsis basic syntax: Text-overflow:clip | Ellipsis if the default value is Text-overflow:clip, the ellipsis (...) is not displayed, but the simple Cero is text-overflo
Single line out of ellipsis#word1 {width:100px; text-overflow:ellipsis; overflow:hidden;}A few lines beyond the ellipsis (compatible with the WebKit kernel only)3; Overflow:hidden;}Compatible wording (but when the text is not long enough when the ellipsis will still exist, you need to determine the JS)#wordNV2 {width:100px; position:relative; overflow:hidden; wor
Http://www.daqianduan.com/6179.htmlpstyle="width: 300px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">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:ellipsi
1.Html:This is the ellipsis display of my content beyond three lines! Css: . con{ Position:relative} /* Multiline text out of width part ellipsis: */ #div1 { position:absolute; width:200px; Overflow:hidden; -ms-text-overflow:ellipsis;text-overflow:ellipsis; Display:-webkit-box; The/** object is d
When we are in the row and column, we often see a line of text exceeding the width, and many people use it.
Overflow: hidden hides out-of-the-box content.CodeWhen the text exceeds the limit, what is the ellipsis?
The answer is yes
Use: white-space: nowrap; text-overflow: ellipsis;-o-text-overflow: ellipsis;
Code Demonstration:
Code
Code high
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 cont
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
In the construction of the foreground article list, you need to implement the div inside the text display two lines, beyond the ellipsis display.Looking for a lot, it seems that only one line display. Finally in Baidu know to find the answer.The answer to Baidu know, the title of the Master's self-answer.The-webkit-private attribute is used.Text-overflow:-o-ellipsis-lastline;Overflow:hidden;Text-overflow:el
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 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
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 imp
We usually design the Web page, because the relevant requirements need a line of fixed width, but sometimes the text is too long to overflow. Today, e-Mentor network on a single line and multiline two cases to explain the overflow of the text with an ellipsis instead.One, single-line overflow1, single-line overflow, out-of-section display ... or intercept. The premises must have a width.Css:{width:xxpx;overflow:hidden;white-space:nowrap;text-overflow:
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
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.