用html标签在宽度上包装javascript行

时间:2015-09-26 15:44:31

标签: javascript jquery html css

是否可以根据宽度(以像素为单位)对以下文本使用javascript(不是css word-break或break-all)进行换行并保留html标签?

我有以下html:

<div>
    <div class="line" id="line-5">
    <b style="font-family: Arial, Helvetica, sans; font-size: 11px;">
        <span class="author-basic">Lorem Ipsum</span>
    </b>
    <span style="font-family: Arial, Helvetica, sans; font-size: 11px;">
         <span class="author-basic">&nbsp;is</span>
    </span>
    <span style="font-family: Arial, Helvetica, sans; font-size: 12px;">
        <span class="author-basic"> sietting industry. Lorem sietting industry. Lorem sietting industry. Lorem sietting industry. Lorem</span>
    </span>
    </div>
</div>

由于

0 个答案:

没有答案