tinymce富文本编辑器的上传图片大小默认为100%,可以在content.min.css.js
里设置默认上传图片的大小
如下代码所示,这样默认上传的图片大小是富文本编辑器的80%,而且图片也不会变形。对于原尺寸不超过富文本编辑器80%宽度的图片不会受改变
.mce-content-body p img{max-width: 80%;width: auto;height: auto;
}
滚动条的配置
1.最简单的方法就是在配置时添加Autoresize插件:
tinymce.init({ selector: "textarea"});
2.相关配置
tinymce.init({ ... plugins: "autoresize", autoresize_bottom_margin: 50, autoresize_max_height: 500, autoresize_min_height: 350, autoresize_on_init: true, autoresize_overflow_padding: 50});
3.修改样式的话
content_style: 'body p img{ max-width: 100%;width: auto;height: auto; }',