Reference study: Http://www.cnblogs.com/lianjun/archive/2011/03/24/1993479.htmlInitial practice in the project (JS Intercept)://character length interception includes mixed Chinese and EnglishfunctionsubStr (str, len) {str=str.tostring ();
Code: Overflow:hidden; White-space:nowrap; Text-overflow:ellipsis; Key code: text-overflow:ellipsis; Explanation: The simple understanding is that I want to limit the text to one line (white-space:nowrap;), that the line is bound (width), and that
Original: CSS Learning Note: Overflow text ellipsis (text-overflow)In CSS3, the basic syntax for the Text-overflow property is as follows:
Clip: Indicates that the omitted text is not displayed and is simply trimmed.
Ellipsis: Indicates
In CSS3, the basic syntax for the Text-overflow property is as follows:
Clip: Indicates that the omitted text is not displayed and is simply trimmed.
Ellipsis: Indicates that an ellipsis is displayed when an object text overflows, and
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
In order to achieve the end of the paragraph beyond the text to replace the ellipsis, write their own plug-ins, and made a simple optimization.Here are the script presentation pages and comments, before introducing the plugin parameters1.lineNum:
To support multiple languages, strings in the database may be saved as UTF-8 encoding, and part of the string may need to be captured using php during website development. To avoid garbled characters, write the following UTF-8 string truncation
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
The substr () function built in PHP cannot be used to truncate Chinese characters, and garbled characters in both Chinese and English may occur. The following two solutions are provided.
1. gb2312 encoding truncation,
1 Function Msubstr ( $
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.