Home > Web Front-end > HTML Tutorial > Example tutorial on limiting the display length of characters and adding ellipses

Example tutorial on limiting the display length of characters and adding ellipses

零下一度
Release: 2017-06-11 13:30:37
Original
2572 people have browsed it

How to solve the problem that the number of words displayed in html text control exceeds the limit? That is, the text overflow control displays the number of words, and the table text overflow control td displays the number of words. When you see the title, you will easily think of the method of truncating the text and adding an ellipsis "...". Haha, that's it. In fact, writing this log is just to record this method, because it seems that many people still don’t remember how to deal with such a situation. The picture below is the display effect of php Chinese website (www.php.cn) when the number of words exceeds the number and ellipses are added. First, let me explain. Generally, if the text in a container using DIV+css exceeds the length, it will float outside the frame or expand the frame. This is generally It's easy to solve, but I encountered this problem today: the test page under IE6 did not respond, but the test page under IE8 processed the overflow text normally, and I was depressed. Isn't this overflow processing unique to IE? Why is IE6 not working properly? Later, I checked online and found out that it turns out that IE6 only supports overflow processing if it is written inside a DIV, and IE6 or above only supports writing it in

  • , so I wrote the same overflow processing code in DIV and < li> It’s normal

    1. HTML text control display word count exceeds the method of using ellipses

    Example tutorial on limiting the display length of characters and adding ellipses

    Introduction: How to solve the problem that the number of words displayed in HTML text control exceeds the limit? That is, text overflow controls the number of words displayed, and table text overflow controls the number of words displayed in td. When you see the title, you will easily think of the method of truncating the text and adding an ellipsis "...".

    2. Use css3 to truncate text and add ellipses

    Example tutorial on limiting the display length of characters and adding ellipses

    Introduction: Limit the number of lines of text displayed in a block element. In order to achieve this effect, it needs to be combined with other foreign WebKit properties.

    3. Example of adding ellipsis code after the intercepted string implemented in pure css_html/css_WEB-ITnose

    Introduction: Example of adding ellipsis code after the intercepted string implemented in pure CSS

    4. How does php limit the display length of characters?

    Introduction: Like the above (interception from Tieba), when the character length exceeds the fixed pixel width, the string within the pixel width range is intercepted, and after the string Add an ellipsis. The mb_strlen function can only get the number of characters, but the width of a character in English and Chinese is different, and it cannot be determined based on the number of characters...

    5. php String interception problem

    #Introduction: I want to display a string with a limited length. If the string exceeds a certain length, intercept the first n characters and add an ellipsis after it.

    6. php string interception problem_php skills

    Introduction: I want to limit the length of a string Display, if the string exceeds a certain length, intercept the first n characters and add an ellipsis

    [Related Q&A recommendations]:

    javascript - Is there any good way to add ellipses at the end of lines when multi-line text overflows?

    javascript - How to add ellipses to the overflow part of multi-line text?

    How to limit the display length of characters in php?

    javascript - Display multiple lines, hide beyond that, and add an ellipsis at the end of the last line?

    The above is the detailed content of Example tutorial on limiting the display length of characters and adding ellipses. For more information, please follow other related articles on the PHP Chinese website!

  • source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template