有没有办法让文本区域在任何时候换行并忽略空格?
这是我现在的行为:
| I want it to |
| wrap anywhere |
Run Code Online (Sandbox Code Playgroud)
这就是我想要的:
| I want it to wr |
| ap anywhere |
Run Code Online (Sandbox Code Playgroud)
我通过使用 css3 "word-break: break-all" 属性找到了一个解决方案。
textarea {
border-width:1px;
overflow: auto;
border: solid;
word-break: break-all;
}
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅CSS3 断字属性。