Support » Theme: Twenty Twenty-Two » Eliminating margin between header and page content

  • Resolved DJ

    (@itsjustdj)


    I’m working in the new 5.9 site editor, using the Twenty Twenty Two theme. I customized my header template, then customized my page template.

    I can adjust the padding for all these separate elements, but I don’t see a margin adjustment setting. There is a gap between the header and page content. How do I eliminate that? Do I have to use custom CSS?

Viewing 5 replies - 1 through 5 (of 5 total)
  • .wp-block-template-part {} I fear

    Thread Starter DJ

    (@itsjustdj)

    That doesn’t seem to be it, no. The margin settings for that element are already at 0px.

    However, I did notice that in the inspector under inherited from body, there is this:

    --wp--style--block-gap: 1.5rem;

    This worked:

    body {
    	--wp--style--block-gap: 1
    		rem !important;
    }
    • This reply was modified 9 months, 3 weeks ago by DJ.
    Thread Starter DJ

    (@itsjustdj)

    Thanks, @andynick.

    Wow! I don’t know what it was previously, but I set mine as follows:

    .wp-block-template-part {
    	max-height: 13rem !important;
    }

    The gap closed up nicely!
    The only way to tell accurately would be on a completely fresh installation.

    Thread Starter DJ

    (@itsjustdj)

    Thanks! Yup, that works even better.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Eliminating margin between header and page content’ is closed to new replies.