TinyMCE width and height disobedient!

前端 未结 12 1006
自闭症患者
自闭症患者 2020-12-14 08:09

According to the (conflicting) documentation of TinyMCE, the editor takes on the size of the textarea (or other) element that it replaces. It also says that you can set the

12条回答
  •  Happy的楠姐
    2020-12-14 08:31

    Add a 'body_id' using tinymce.init and then use that id in 'content_css' to give the editor the desired css behavior. Like so:

    tinymce.init({
        selector: "textarea",
        content_css: '/css/app.css',
        body_id: 'new-journal-editor'
    });
    

    And then in app.css:

    #new-journal-editor {
        height: 123px;
        width: 123px;
    }
    

提交回复
热议问题