1, "CSS3 How to implement beyond the specified text to show the ellipsis effect"
Original source: Http://blog.csdn.net/billfeller/article/details/40436491?utm_source=tuicool
Do not do the front end for a long time, today from the refactoring learned that CSS3 has been able to achieve a lot of the past must be through JS to achieve the effect, such as gradient, shadow, automatic truncation text display ellipsis
1, single-line text overflow display ellipsis CSS notation1 Overflow:hidden; 2 text-overflow:ellipsis; 3 White-space:nowrap; /* No Line break */2, multiple lines of text display ellipsisThis is achieved based on the application scenario.1) WebKit Browser or mobile pageYou can use the private property of WebKit:-webkit-line-clamp (This property is not part of the CSS specification), which is used to display the number of lines of text displayed by the
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
Test browser: IE6/7/8/9, opera12.02, firefox15.0.1, Chrome
The code is as follows
Copy Code
If we want to define text-overflow:ellipsis for P tags, we can write this:
code is as follows
copy code
P { White-space:nowrap; width:100%; /* IE6 need to define width */ Overflow:hidden; NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP - o-text-overflow:ellipsis;/* Opera */ text-overflow:
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
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
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
Someone would ask, why I took text-overflow out alone to explain. Previously, when a line of content is not complete, you want to display the ellipsis, you need to use JavaScript and other means.But CSS3 introduced the text-overflow ellipsis attribute, only need a short line of code can be implemented, the development of a simple and powerful way of self-evident.This article, I said to lead you to make a "t
-weight:bold;/* Adjust text and bold display */-webkit-border-top-left-radius:8px; /* Set the upper-left and top-right rounded effect of the title row */-moz-border-top-left-radius:8px;border-top-left-radius:8px;-webkit-border-top-right-radius:8px;-moz-border-top-right-radius:8px;border-top-right-radius:8px;}
Run the HTML page to see the effect after the modification, now our list border, the list header style is already good: Finally, let us useText-overflowTo setellipsisStyle it. Add t
convention shown in the first example (the ellipsis is attached to TypeName).In the previous example, Arguments is a parameter package. Class ClassName can accept a variable number of arguments, such as the following example:
Template
You can also require at least one parameter by using the variable parameter template class definition.
Template
The following is a basic example of the variable parameter template function syn
A very tangled title, really do not know how to describe the phenomenon.Film Bar, first look at what the demand is.1. Need:?The video and ticket icons are displayed after the title, and when the title is too long the icon displays to the ellipsis ... After (the TextView ellipsis is displayed, the icon automatically leans back).2. Problem solving?Originally is a very normal demand, looks very simple, but did
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 find the essential cause. The essence is that, t
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 add a style. height20{height:20px;}Second, t
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
Thinkphp intercepts string functions and cannot display ellipsis. how can this problem be solved?
If thinkphp's string truncation function cannot display ellipsis, you can refer to the following solution: Open the common/extend. php page and modify the msubstr function:
Function msubstr ($ str, $ start = 0, $ length, $ charset = "UTF-8", $ suffix = true)
{
If (function_exi
Because of the actionbar between the different devices for the left side of the hidden part, 4.2 will have an ellipsis, and the previous version needs to click on the virtual key menu can be called out, this method is to cast the 4.2 version below the right ellipsis/** Device Configuration Changes */@Overridepublic void onconfigurationchanged (Configuration newconfig) {Super.onconfigurationchanged (Newconfi
Today I made an example of a module.The title and description of the two parts must be truncated by a line or two lines of text beyond a certain width, and replaced by a ellipsis.Because it is a mobile phone page, JS is too overhead, you can only start with CSS.A row is a good solution.As shown in the following figure.White-space: nowrap; overflow: hidden; text-overflow: ellipsis;I 've been thinking about multiple lines for a long time. For example, i
Implementation of multi-line text ellipsisHic facilis eius eveniet quisquam, Voluptatibus Molestias, Soluta. Odit dicta et OmnisFugiat magnam commodi reiciendis consequatur quoslorem ipsum dolor sit amet, consecteturAdipisicing elit. Impedit quis dolore, Assumenda veniam deserunt suscipit Maxime, MagniDoloremque Excepturi praesentium ea ullam earum rem vel voluptatibus ex omnis odio ipsum.Several properties to be aware of:
Text-overflow:ellipsis: An overflow display
The problem in question is split into two:
1. How do I use ellipsis instead of text when the length is exceeded?
2. How long is the length of the text after the omission of the display, how to hover when the mouse, in the form of a floating box to display all the information?
How do I implement ellipsis instead of text when it exceeds length?
Using CSS to implement a very long field with ellipses notati
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.