【问题标题】:Primefaces CKEditor hardcoded pixel width?Primefaces CKEditor硬编码像素宽度?
【发布时间】:2013-10-16 09:57:40
【问题描述】:

我在 CKEditor 中使用 Primefaces 3.5 和 primefaces-extensions 0.7.1。我正在尝试使用站点范围的 CSS 配置文件设置编辑器的宽度,在该文件中我为生成的 span 标记的类指定属性以包装编辑器区域。我的问题是这个span 标签还获得了一个属性style="width: 600px;",它覆盖了类的属性。

我使用 Firefox 开发工具验证,如果此属性不存在,我的类样式属性将生效,我会得到我正在寻找的结果,但我不知道为什么 CKEditor 添加了此属性,所以我无法删除它。

在我看来,CKEditor 中会有一个硬编码的像素值,但我在我的应用程序中看不到任何可以设置它的东西。所以我想知道是否有其他人遇到过这个问题,也许还有解决方案。

编辑: PS。我在 Primefaces Extensions 展示网站 showcase site 上查看了 CKEditor 生成的 html,它还包含神秘的 style="width: 600px"attribute,这让我更加确信在我自己的应用程序中没有设置值。

编辑:更新到 primefaces-extensions 1.0.0 没有帮助

【问题讨论】:

    标签: ckeditor primefaces-extensions


    【解决方案1】:

    你可以只使用 pe:ckEditor 标签的 width 属性,例如:

    <pe:ckEditor id="my_editor" width="800px" value="#{myBean.message}" />
    

    <pe:ckEditor id="my_editor" width="50%" value="#{myBean.message}" />
    

    我正在使用 Primefaces 4.0 和 Primefaces Extensions 1.2.1 和 resources-ckeditor 1.2.1,效果很好。

    【讨论】:

      猜你喜欢
      • 2018-12-22
      • 1970-01-01
      • 2011-12-17
      • 1970-01-01
      • 2013-05-22
      • 1970-01-01
      • 1970-01-01
      • 2017-07-27
      • 2011-08-24
      相关资源
      最近更新 更多