我刚刚创建了一个div。White-space: Normal
当我输入内容时,我提供了自动换行的功能。此功能可在Chrome,Opera和Safari浏览器中使用。但是这些词在Mozilla Firefox和Edge浏览器中没有包装。我也尝试了该Word-wrap: break-word
功能。这也不起作用。请给我一个解决方案。
<div class = "list-name-field" id = "SAVE_LIST" style = "white-space: normal; width: 240px; min-height: 35px; border-radius: 3px; margin-left: auto; margin-right: auto; background-color: #ccc; margin-top: 5px; " contenteditable = "true" data-placeholder = "Add a List..."></div>
word-break: break-all
如果您需要打断长词,则需要添加
<div class = "list-name-field" id = "SAVE_LIST" style = "white-space: normal;word-break: break-all; width: 240px; min-height: 35px; border-radius: 3px; margin-left: auto; margin-right: auto; background-color: #ccc; margin-top: 5px; " contenteditable = "true" data-placeholder = "Add a List..."></div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句