You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, the images are wrapped by .wp-block-image, no matter their alignment. No other class is added, making impossible to stylize following elements based on image alignment.
Describe the solution you'd like
Is it possible to add a class to the wrapping div? Something like .wp-block-image--left-aligned-child and wp-block-image--right-aligned-child.
@robsonsobral I think this issue will need some more information to be able to progress.
Here's the HTML markup I see when aligning an image block in Gutenberg v8.5.
editor:
post:
This seems different to what you mentioned above when you mention a wrapping div with the class .wp-block-image. Checking an older version, it seems like this has changed, so it might be worth testing against more recent versions of the plugin.
Related to your issue I'd also recommend taking a look at #20650, which talks about some of the issue with alignments and potential solutions.
Activity
talldan commentedon Jul 16, 2020
@robsonsobral I think this issue will need some more information to be able to progress.
Here's the HTML markup I see when aligning an image block in Gutenberg v8.5.
editor:

post:

This seems different to what you mentioned above when you mention a wrapping div with the class
.wp-block-image. Checking an older version, it seems like this has changed, so it might be worth testing against more recent versions of the plugin.Related to your issue I'd also recommend taking a look at #20650, which talks about some of the issue with alignments and potential solutions.
robsonsobral commentedon Jul 16, 2020
Thank you, @talldan ! I gonna look at that issue!
Running Gutenberg 8.5.1:
Is there a command I can run on console, to check the running version?
Mamaduka commentedon Apr 2, 2025
I'm going to close this issue. I believe it was resolved after the block migration to v2. Now, alignment classes are applied to the
figureelement.