• Resolved bitsquid

    (@kimingdal)


    Hi.

    I’m struggling to understand how alignment works with custom blocks containing innerblocks.

    I have created a custom headerblock, which contains a InnerBlocks element. Whenever I set the custom headerblock to align-wide, the InnerBlocks div also inherits the alignwide class.

    Could anyone please explain why this is, and how I might avoid it?
    I would really like to be able to align the block wide or full, but prevent the innerblocks from getting the same align property.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s normal for child objects to inherit their parent’s properties. Usually it’s implicit, not explicit as it is here. IDK if that’s really why, I’m only speculating.

    Regardless of the class assigned to children, you can apply any appropriate CSS to achieve the layout you want. This will be a lot easier to accomplish than trying to override default block behavior.

Viewing 1 replies (of 1 total)
  • The topic ‘Innerblocks div inherits the align property of the parent block’ is closed to new replies.