CSS溢出自动

Siv*_*va 1 javascript css overflow css3

嗨我在我的网页上做评论框,以便我通过不允许用户输入空注释来对该评论框进行验证,并且评论sholud不大于255个字符它一切正常但是当我输入评论时这意味着

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaakjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
Run Code Online (Sandbox Code Playgroud)

这个字符串溢出了注释框div,即它就像一条直线,我用过css属性overflow:auto; 但我需要的是它应该像这样显示.它应该拆分字符串

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaakjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
Run Code Online (Sandbox Code Playgroud)

对于前:当我这样评论 The p element has both line boxes and a child box for the q element, which is a block-level element. The line boxes before the q are wrapped in an anonymous block-level box and so are the line boxes after the q. The resulting tree of boxes might be as fol

它恰到好处...它应该是这样的

kap*_*apa 9

你需要的是CSS word-wrap: break-word;.它在浏览器中得到广泛支持.

CSS3.info上的自动换行

自动换行:破解词