我的 div 没有像预期的那样使用react(可编辑)。 它在键入时继续处理文本:
我需要让它自动换行,我不知道它是 css 部分还是 JS 部分,我尝试了我能在互联网上找到的所有 css 部分。 Hare 是我的 div CSS:
height: 600px;
width: 1100px;
clear: left;
line-height: 14pt;
float:left;
overflow:hidden;
最佳答案
将 word-wrap:break-word;
与 display:inline-block;
一起使用:
#mydiv{
display:inline-block;
word-wrap:break-word;
height: 600px;
width: 300px;
clear: left;
line-height: 14pt;
float:left;
overflow:hidden;
}
<div id='mydiv'>
Please,couldyoustopthenoiseI'mtryingtogetsomerestFromallthunbornchickenvoicesinmyheadWhenIamking,youwillbefirstagainstthewall
</div>
关于javascript - 可编辑的 Div 不换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43659788/