p!= ‘<width: 50px><word-wrap: break-word>’ + articles[i].article
這個不工作啊。求教! 就是限制一行文本的长度
什么标签名字 width…?
width
@jiyinyiyong yes. something like this:
<div style=“word-wrap: break-word; width:50px;”>Textttttttttttttttttttttttttttttttttttttttttttttttttttttttt</div>
需要设置 overflow: hidden; text-overflow: ellipsis; 之类的, 不然文本直接溢出. 极端的时候还要用一下 white-space: nowrap; 限制换行之类的
overflow: hidden; text-overflow: ellipsis;
white-space: nowrap;
@andersbills
如果是这一段HTML片段,对应的Jade脚本应该是:
div(style="word-wrap: break-word; width:50px;")=articles[i].article
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
什么标签名字
width…?@jiyinyiyong yes. something like this:
<div style=“word-wrap: break-word; width:50px;”>Textttttttttttttttttttttttttttttttttttttttttttttttttttttttt</div>
需要设置
overflow: hidden; text-overflow: ellipsis;之类的, 不然文本直接溢出. 极端的时候还要用一下white-space: nowrap;限制换行之类的@andersbills
如果是这一段HTML片段,对应的Jade脚本应该是: