JS intercepts strings and hides them.
<SCRIPT>
Function substr (OBJ )...{
/** // * Obtain the pixel occupied by the character */
String. Prototype. boldwidth = stringboldwidth;
Function stringboldwidth ()...{
VaR II = 0;
VaR A = This. Replace (/[
Use CSS to intercept a string:
Add the following statement to the CSS style:
Overflow: hidden;
White-space: nowrap;
Text-overflow: ellipsis;
In this way, if the character reaches the specified width, it is automatically truncated, followed by a ellipsis. It is much easier to intercept PHP characters!
<HR>
<Style type = "text/CSS">...
. Title
{...}{
Width: 200px;
White-space: nowrap;
Word-break: Keep-all;
Overflow: hidden;
Text-overflow: ellipsis;
}
</Style>
<SPAN class = title> the title displayed on the client is too long. the unused part is omitted and the ellipsis is added. </span>
<HR>
<Div class = title> the client solves the problem. The title is displayed too long. the unused part is omitted and the ellipsis is added. </div>