The solution is as follows:
css code:
display: -webkit-box; display: -moz-box; white-space: pre-wrap; word-wrap: break-word; overflow: hidden; text-overflow: ellipsis; -webkit-box-orient: vertical; - webkit-line-clamp:2; /*Display the number of lines*/Method 2: Use jQuery to intercept and replace the text content.
The solution is as follows:
js code:
$(.text).each(function() { if ($(this).text().length > 20) {//Require word count to be greater than 20 before word count replacement $(this).html($(this). text().replace(//s+/g, ).substr(0, 80) + ...) //Start replacing from 0 to 80 and replace the remaining text content with... }})The above two methods can be applied to the class name of the text content.
SummarizeThe above are the two common solutions to the omitted characters when HTML text overflows and is introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for your support of the VeVb martial arts website!