data-align="center" does not work

Created on 4 December 2024, 18 days ago

Problem/Motivation

To center the images I need the data-align="center" class. I think it's a ckeditor problem and I opened an issue. They replied that it probably depends on the theme.
I don't think so, because I have this problem with all the themes and with all the versions of drupal. Please, I ask for a verification on the page https://prova.gmpe.it/prove

Steps to reproduce

Drupal 10 and Drupal 11
1. I insert the image with IMCE
2. I align the image to the center
3. I verify that the source code contains data-align="center"
4. I Save

The image remains on the left.

If I insert data-align="right", the image aligns correctly to the right.

Thanks and best regards

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇮🇹Italy giordy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @giordy
  • 🇺🇸United States flashwebcenter Austin TX

    Hello,
    Please open gmpe-style.css and on line 18 replace:

    .field--type-text-long img,
    .field--type-text-long video,
    .field--type-text-long embed,
    .field--type-text-long object,
    .field--type-text-with-summary img,
    .field--type-text-with-summary video,
    .field--type-text-with-summary embed,
    .field--type-text-with-summary object {
      display: inline-block;
    }

    with:

    .field--type-text-long img:not(img.align-center),
    .field--type-text-long video:not(video.align-center),
    .field--type-text-long embed:not(embed.align-center),
    .field--type-text-long object:not(object.align-center),
    .field--type-text-with-summary img:not(img.align-center),
    .field--type-text-with-summary video:not(video.align-center),
    .field--type-text-with-summary embed:not(embed.align-center),
    .field--type-text-with-summary object:not(object.align-center) {
      display: inline-block;
    }

    Best wishes,
    Alaa

  • 🇺🇸United States flashwebcenter Austin TX
  • 🇮🇹Italy giordy

    Thank you so much. It works perfectly.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024