How to prevent horizontal scrolling of MCE editor

2019-05-10 07:33发布

I am using TinyMCE text editor and the text within the does not roll over when the line goes beyond the width, rather a scroll bar appears and the text goes on horizontally. How can I confine the text withing the text box width and not have a horizontal scroll bar.

2条回答
做自己的国王
2楼-- · 2019-05-10 08:09

There's a param in TinyMCE that adds CSS style which makes text spread wide without wrapping it by the container box (adding horizontal scrollbar). It's boolean "nowrap". To make text wrapped inside the container box set it to false (this actually a default):

 tinymce.init({ 
        ...
        nowrap : false
        });
查看更多
我想做一个坏孩纸
3楼-- · 2019-05-10 08:13

.tinymce-content { white-space: normal; }

This sounds like a CSS issue. Can you provide a working example or demo URL? It sounds like the text is not wrapping to its container.

Also, text won't wrap unless it contains spaces or hyphens, if that makes a difference.

查看更多
登录 后发表回答