Title: Inconsistent nested container alignment
Last modified: January 21, 2025

---

# Inconsistent nested container alignment

 *  Resolved [frzsombor](https://wordpress.org/support/users/frzsombor/)
 * (@frzsombor)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/inconsistent-nested-container-alignment/)
 * I have a few top level Containers on a page (sections) and in each “Container”,
   there is an “Inner Container” (also a GB Container). They both are `display:block`
   by default. Each “Inner Container” has a similar named global class `.inner-container`,
   which has `margin-left:auto` and `margin-right:auto` set to center them. With
   this, the “Inner Container” is automatically positioned to center on the frontend.
   However, if I don’t set the “auto” margins explicitly on the “Inner Container”
   blocks in the Block Editor, the container floats to the left, because in Block
   Editor, there is also a hardcoded `.gb-container>.wp-block { margin-left:0; margin-
   right:0 }` css, coming from _“generateblocks/dist/blocks.css”_, which overwrites
   the Global Style’s CSS.
   See: [https://imgur.com/a/udJV9DJ](https://imgur.com/a/udJV9DJ)
 * Is this something you are aware of? I’ve tried temporarily disabling `.gb-container
   >.wp-block` CSS in inspector, and this way some containers showed up correctly,
   but also others are don’t. I realized that the reason is that WP Block Editor’s
   default CSS also defines `margin-left:auto` for all `.wp-block` and in the Block
   Editor (and only there) all `.gb-container` are also a `.wp-block`. This causes
   inconsistency with margins on blocks in the Block Editor and the Frontend.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [ying](https://wordpress.org/support/users/yingscarlett/)
 * (@yingscarlett)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/inconsistent-nested-container-alignment/#post-18257517)
 * Hi there,
 * Global styles are a GB Pro feature, we are not allowed to offer support to questions
   related to the pro version per WP’s regulation.
 * Any chance you can post the question in [GB’s pro forum](https://generate.support/)?
   Thanks for your understanding!
 * Btw I’m not aware of this issue before, would be happy to take a look!
 *  Thread Starter [frzsombor](https://wordpress.org/support/users/frzsombor/)
 * (@frzsombor)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/inconsistent-nested-container-alignment/#post-18263089)
 * Hi [@yingscarlett](https://wordpress.org/support/users/yingscarlett/),
 * Thanks for your reply, I understand.
 * However, just for future reference, in the meantime, I was able to verify that
   this issue seems like fixed in v2.0 Beta! I have also verified that the issue
   was using `:where(.editor-styles-wrapper) .my-global-style-class` in v1, but 
   in v2 the style is defined as `.editor-styles-wrapper .my-global-style-class`,
   which has higher priority than the other styles.
 * Marking as “resolved” for now.
 *  Plugin Support [ying](https://wordpress.org/support/users/yingscarlett/)
 * (@yingscarlett)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/inconsistent-nested-container-alignment/#post-18264333)
 * Glad to hear that 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Inconsistent nested container alignment’ is closed to new replies.

 * ![](https://ps.w.org/generateblocks/assets/icon.svg?rev=3239461)
 * [GenerateBlocks](https://wordpress.org/plugins/generateblocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/generateblocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/generateblocks/)
 * [Active Topics](https://wordpress.org/support/plugin/generateblocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/generateblocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/generateblocks/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [ying](https://wordpress.org/support/users/yingscarlett/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/inconsistent-nested-container-alignment/#post-18264333)
 * Status: resolved