How to make TinyMCE Responsive

后端 未结 6 1912
抹茶落季
抹茶落季 2020-12-28 17:18

I am making a Responsive site using the foundation framework and TinyMCE breaks the format when the page is scaled down(it\'s not responsive). How do I make TinyMCE responsi

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-28 18:03

    The TinyMCE editor can be made responsive by using css media queries. Simply add css rules that set the width property of table.mceLayout and the tinyMCE textareas. You will need to enforce these css rules using !important because they would otherwise be overwritten.

    E.g., I use css similar to this:

    /* on mobile browsers, I set a width of 100% */
    table.mceLayout, textarea.tinyMCE {
        width: 100% !important;
    }
    
    /* on large screens, I use a different layout, so 600px are sufficient */
    @media only screen and (min-width: 600px) {
        table.mceLayout, textarea.richEditor {
           width: 600px !important;
        }
    }
    

    See this jsfiddle: http://jsfiddle.net/johannesjh/384uf/

    Note: You may wish to use different media queries or css classes to make use to the "foundation framework"'s responsive grid.

提交回复
热议问题