legacy-knowledge-base
公開されました Jul. 2, 2025

CKEditor使用時、タグ内でサイズを%で指定するとpxに変換されてしまう

written-by

Yu Kakiuchi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

事象

  • CKEditor使用時、タグ内でサイズを%で指定するとpxに変換されてしまう

環境

  • DXP7.2-FixPack18以降

解決

  • 本事象はDXP7.2のFixPack18でバージョンアップされた、サードパティ製のCKEditorの仕様によるものです。
  • 以下の代替案が考えられます。
  1. インラインスタイルの変換が行われないよう、CKEditorをカスタマイズする
  2. クラスで管理する(テーマ内もしくはページ設定のカスタムCSSにて、下記のようなクラスを作成し呼び出し側で利用する)
    .className {
    width : 100%;
    }
  3. デフォルト設定のAlloyEditorを利用する

     ※ DXP7.2のFixpack18以降にバージョンアップした場合、コンテンツを更新した際にpx指定に変換されます。

did-this-article-resolve-your-issue

legacy-knowledge-base