0
我正在寻找一个脚本来在一些单词后面换行。我在计算器发现这个位置:Applying a style to and inserting a line break after the first word in a link添加换行符(例如8)字
所以,我改变了一点:
var el = $('.wtt'); //where wtt is the class of the elements that you want to add the <br />
var text = obj.html();
var parts = text.split(' ');
//number 7 represents 8 words
$('.wtt').html($('.wtt').html().replace(parts[7],parts[7]+'<br />'));
任何反对CSS的反对:'.wtt {width:200px;自动换行:打破字;白色空间:正常;}'? –