【发布时间】:2018-08-02 05:28:57
【问题描述】:
TinyMCE 从内联样式中移除 background-size 属性。
我试过了:
<div style="background: url(img_url_here) no-repeat center;background-size: cover;"><div style="background: url(img_url_here) no-repeat center / cover;">
部分配置(没有菜单和其他不相关的东西):
default_config = {
statusbar: false,
relative_urls : false,
convert_urls: false,
entity_encoding: "raw",
extended_valid_elements : "em[class|name|id]",
valid_children : "+*[*]",
valid_elements:"*[*]",
};
我也尝试过使用valid_styles,但没有成功,然后它会删除所有样式,例如:
valid_styles:"*[*]"
valid_styles:"+[*]"
我在 Google 上找到了这两种用法。可以一一设置,但我想允许所有样式: https://www.tiny.cloud/docs/configure/content-filtering/#valid_styles
也许可以删除样式“检查”,因为,例如如果我错误地输入了一些样式,它将被自动删除。也许 TinyMCE 无法识别background-size 并视为无效。
感谢您的帮助!
【问题讨论】: