• Resolved Deryck

    (@deryck)


    Hi all,

    ?How can I remove the margin-block-start to main.wp-block-group element without disabling blockGrap to all blocks or using custom CSS?

    I’m using blockGap and I’m ok with that. However I’m trying to get rid of the first gap we got here.

    div.wp-site-blocks > main.wp-block-group

    That on has the following styles applied.

    .wp-site-blocks > * + * {
        margin-block-start: 24px;
    }

    It’s adding a space to the first element after the header element in the page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can edit the page template and add zero top margin to the main Group block.

    In the Group block controls go to Dimensions, toggle on the Margin control, and change the top margin to “0”. It will appear blank/empty, but adding zero top margin will override the site-wide block gap at the top of the main Group block.

    Thread Starter Deryck

    (@deryck)

    Thanks so much @uxl it worked fine.

    PURPOSE Remove White Space between Header, Body, Footer

    To remove the block-gap between the elements (Header, Body, Footer) of the Twentytwentytwo Theme. This is preferable if using a colored background as the block-gap is white.

    1. Modify the template by placing the three elements in a Group. Set that group’s settings to BLOCK SPACING 0 rem (In Dimensions).
    2. Place each of the elements in it’s own group (ensuring that the group is enclosed in the main Group). Set that group’s BLOCK SPACING 1.5 rem (or your choice). This will ensure the theme’s spacing is retained for each element.
    • This reply was modified 1 year, 10 months ago by bem007.
    • This reply was modified 1 year, 10 months ago by bem007.

    Correcting previous post.

    PURPOSE Remove White Space between Header, Body, Footer

    To remove the block-gap between the elements (Header, Body, Footer) of the Twentytwentytwo Theme. This is preferable if using a colored background as the block-gap is white.

    1. Modify the template by placing the three elements in a Group. Set that group’s settings to BLOCK SPACING 0 rem (In Dimensions).
    2. Inside of each element, place the contents of the element in a Group. Set that group’s BLOCK SPACING 1.5 rem (or your choice). This will ensure the theme’s spacing is retained for each element.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to get rid of blockGap in first and parent wp-block-group’ is closed to new replies.