【问题标题】:Move the whole word in contenteditable div to next line in case there is no place将 contenteditable div 中的整个单词移动到下一行,以防没有位置
【发布时间】:2019-12-18 15:00:08
【问题描述】:

我有一个内容可编辑的 div。当我在里面输入时,如果我在行尾输入一个单词并且整个单词没有位置,它会移动到下一行,但是当我打开它时,它会在中间中断并且其中一部分移到下一行。 在任何情况下,我都希望它把整个单词移到下一行。

when I am typing the text when I open it filled:

【问题讨论】:

    标签: css contenteditable word-break


    【解决方案1】:

    您应该能够在您的 css 中使用以下内容。

    word-wrap: break-word
    

    jsFiddle: https://jsfiddle.net/3obyr7k2/

    【讨论】:

      【解决方案2】:

      您需要在段落标签中添加word-break: normal;

      希望对你有帮助!

      【讨论】:

        猜你喜欢
        • 2020-03-31
        • 1970-01-01
        • 1970-01-01
        • 2014-05-25
        • 1970-01-01
        • 2021-02-13
        • 1970-01-01
        • 2023-01-22
        • 2020-12-23
        相关资源
        最近更新 更多