The use of text-overflow:ellipsis to overflow text display ellipsis has two advantages, one is not through the program to limit the number of words, the second is conducive to SEO. You need to use a list of article headings that display ellipses for overflow text, which is more friendly to search engines because the title is not actually truncated, but is limited to width and not displayed. The
usual practice is this:
1.overflow:hidden;
2.text-overflow:ellipsis;
3.-o-text-overflow:ellipsis;
4.white-space:nowrap;
5.width:100%;
Among them, Overflow:hidden and white-space:nowrap are necessary, otherwise the ellipsis will not be displayed;-o-text-overflow:ellipsis is for opera, and the width is set mainly for IE6;
This method supports Internet Explorer, Safari, Chrome, and Opera, but FF does not support it, but it can be done with jquery for similar effects.
Download this jquery plugin: jquery ellipsis plugin
call method:
1.$ (document). Ready (function () {
2. $ ('. Ellipsis '). ellipsis ();
3.}