Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#63593 closed defect (bug) (reported-upstream)

Center Mode doesnt work in Guttenberg editor

Reported by: eeprom_one's profile eeprom_one Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: css Cc:

Description

hi Dear,

when i try to center:

  • Embemded WordPress
  • Predefined Call to action template

and try to center it, clicking in the center mode, in the editor is running well, BUT in the front end its crashed.

please help me

Attachments (2)

22222.png (221.3 KB) - added by eeprom_one 8 months ago.
1111.png (167.4 KB) - added by eeprom_one 8 months ago.

Download all attachments as: .zip

Change History (3)

@eeprom_one
8 months ago

@eeprom_one
8 months ago

#1 @sabernhardt
8 months ago

  • Component changed from Formatting to Editor
  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed
  • Version 6.8 deleted

Centering Embed blocks is a known issue, and I'll close as 'reported-upstream' because of that.

The rule .post-content-wrap h2 { text-align: inherit; } in your site's CSS overrides the alignment for the .has-text-align-center class. The inherit rule (for all heading levels) likely comes from the Houzez premium theme, but it might come from one of the plugins.

Custom CSS to add

The Customizer (under Appearance) has an Additional CSS panel, and maybe your theme has another place to assign special styles.

I tried changing the width of the figure element, and it worked with the WordPress post embeds (on the front end):

.wp-block-embed.aligncenter {
	width: fit-content;
}

GB41011 proposed this instead, and it worked for me too:

.wp-block-embed.aligncenter .wp-block-embed__wrapper {
	display: flex;
	justify-content: center;
}

For the heading(s), you could increase the specificity. Adding an element selector seems sufficient:

html .has-text-align-center {
	text-align: center;
}

Or you might like to raise the specificity level higher with something like :root or class names:

:root .has-text-align-center {
	text-align: center;
}

If you need help with other aspects of your site, please use the support forums.
https://wordpress.org/support/forums/

Note: See TracTickets for help on using tickets.