【问题标题】:Set font-size to parent element (paragraph, h1, h2) in CKEditor在 CKEditor 中将字体大小设置为父元素(段落、h1、h2)
【发布时间】:2016-03-17 08:23:33
【问题描述】:

当我将字体大小设置为所选文本时,CKEditor 创建新元素跨度并设置字体大小。

如果我将 font-size 设置为 H1 元素,它会在 H1 内创建新的 span 并将 font-size 设置为 span。

结果是假的行高。

<h1>
    <span style="font-size:10px;">Hello</span>
</h1>

//I want

<h1 style="font-size:10px;">
    <span style="font-size:10px;">Hello</span>
</h1>

除了跨度之外,如何将字体大小设置为父元素 h1,h2,p,ecc...?

谢谢!

【问题讨论】:

    标签: plugins ckeditor wysiwyg ckeditor4.x


    【解决方案1】:

    在 CKEDITOR.config 中有 set_style 和 format_h1

    其他选项是更改 contents.css 中的样式

    【讨论】:

    • 问题出在运行时。当我更改跨度的字体大小时,我想更改父元素的字体大小,例如 H1 或段落
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-21
    • 1970-01-01
    • 2012-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-13
    相关资源
    最近更新 更多