How to prevent horizontal scrolling of MCE editor

半腔热情 提交于 2019-12-07 09:08:54

问题


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.


回答1:


.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.




回答2:


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
        });


来源:https://stackoverflow.com/questions/8464929/how-to-prevent-horizontal-scrolling-of-mce-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!