TinyMCE width and height disobedient!

前端 未结 12 1002
自闭症患者
自闭症患者 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条回答
  •  北海茫月
    2020-12-14 08:21

    I know all about this, it is very annoying.

    Adding this to any loaded CSS file fixed the width for me (I just put it in the global css, not in any of the TinyMCE css files, I did not test with height):

    .mceEditor > table {
        width:/* my width */ !important;
    }
    

    This would affect all instances, which was fine in my case. You can target the toolbar itself with .mceToolbar

    You kind of do want TinyMCE to resize the textarea, so it can be wide enough to fit all the toolbar icons.

提交回复
热议问题