我有一个字符串,我需要它不要破坏不同行中的两个特定单词。例子:
"Ask for it it when contracting until 2016/09/30 with T-2 Rate"
当我调整窗口大小并使其变小时,它会输出以下内容:
"Ask for it it when contracting until 2016/09/30 with T-2 \n
Rate"
我想T-2 + Rate
永远在一起。怎么做?
你用一个不间断空格。它的 HTML 实体是
。您可能需要一个不间断的连字符 (‑
) in T-2
还有:
Ask for it it when contracting until 2016/09/30 with T‑2 Rate
Example:
var target = document.getElementById("target");
var originalWidth = target.innerWidth || target.clientWidth;
var width = originalWidth;
tick();
function tick() {
width = width < 10 ? originalWidth : (width - 10);
target.style.width = width + "px";
setTimeout(tick, 400);
}
#target {
display: inline-block;
border: 1px solid #ddd;
}
<div id="target">Ask for it it when contracting until 2016/09/30 with T‑2 Rate</div>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)