【问题标题】:How to align an image center in ckeditor 3?如何在ckeditor 3中对齐图像中心?
【发布时间】:2012-11-22 14:54:37
【问题描述】:

在 ckeditor 3 的最新可用版本中似乎没有办法使图像居中。包含一个错误,但没有解决方案:

http://dev.ckeditor.com/ticket/8938

看起来它在 ckeditor 4 beta 上也没有改变。

我想知道是否有人成功编辑了 ckeditor 3 以允许图像居中?

谢谢, 大卫

【问题讨论】:

标签: javascript ckeditor wysiwyg fckeditor


【解决方案1】:

此问题绝对与 ckeditor 无关。自 HTML 4 起,<img> 标记的 align 属性已弃用,自 HTML 5 起已删除。

来自W3C网站source:

img 元素的 align 属性已过时。改用 CSS。

现在,即使该属性已在 HTML 中使用但未在 ckeditor 中使用 - 您也可以在最终输出中看到它(在生产中,最终网站)。

有一些不同的解决方案:

  • 在 HTML5 中,您可以使用 <center><img ... /></center> 或 <img style="margin:0px auto;display:block" ... />

  • 在任何 HTML 版本中,您都可以使用 <div style="text-align: center;"><img ... /></div>(或任何其他标签容器,如 <p> <span> 等。

【讨论】:

    猜你喜欢
    • 2016-11-08
    • 1970-01-01
    • 2017-01-25
    • 2021-07-04
    • 1970-01-01
    • 1970-01-01
    • 2021-08-12
    • 1970-01-01
    • 2020-01-10
    相关资源
    最近更新 更多