TinyMCE: Using CSS class attributes with the formatselect-dropdown formats

守給你的承諾、 提交于 2019-12-06 03:43:08

There is no smart way to do this in the current TinyMCE version according to its main developer:

We have plans for a advanced style format plugin. So that you can specify formats, styles, containers, wrappers etc in a JSON style structure.

Best regards,

Spocke - Main developer of TinyMCE

...though there is an "unsmart" way to achieve this:

A CSS-class h2.foo defined in TinyMCE's content_css will appear in the styleselect dropdown as foo.

You can now select a <h2>-text and choose the style foo from the styleselect dropdown. This results in <h2 class='foo'>.

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