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;自動換行:打破字;白色空間:正常;}'? –