Html node.js如何使用样式限制文本行的长度

Html node.js如何使用样式限制文本行的长度,html,css,pug,Html,Css,Pug,使用此代码 div.col-md-4 //#style({'word-wrap': 'break-word'}, {'width': 50px}) h2 a(href='/u/'+posts[j].user)=posts[j].user !='says' p!='<small>' + posts[j].time + '</small>' p!= posts[j]

使用此代码

      div.col-md-4    //#style({'word-wrap': 'break-word'}, {'width': 50px})
        h2
          a(href='/u/'+posts[j].user)=posts[j].user 
              !='says'
        p!='<small>' + posts[j].time

 + '</small>'
    p!= posts[j].post
div.col-md-4/#style({'word-wrap':'break-word'},{'width':50px})
氢
a(href='/u/'+posts[j].user)=posts[j].user
!='说
p!=''+波斯特[j].时间
+ ''
p!=波斯特[j].波斯特
我想用这个款式

<div style="word-wrap: break-word; width:50px;">

限制一行文字的长度。
我试着把它放在p后面!或者在div之后,什么都不起作用

您可以添加除CSS类和带括号的ID之外的属性:

div.some-class(align=“center”)

所以,要回答你的问题:


div.col-md-4(style=“word wrap:break word;width:50px;”)
可能是这样的:

div.col-md-4(style="word-wrap: break-word; width:50px;")