Title: Remove Gaps Between Blocks
Last modified: March 9, 2021

---

# Remove Gaps Between Blocks

 *  [generalnumpty](https://wordpress.org/support/users/generalnumpty/)
 * (@generalnumpty)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/remove-gaps-between-blocks/)
 * I am using Astra with just the WP default page builder.
    I am trying to remove
   the top and bottom gaps between all blocks and found some CSS to set margin to
   zero but can only find individual CSS for separate blocks. I still need to find
   one for removing the gap on a gallery block.
 * Once the margins are zero I then use the spacer to adjust on a white background
   where the text is too close to the bottom or top.
    And if that paragraph block
   has a coloured background I add another paragraph block underneath and then colour
   it the same but do not write anything in it. This then has the effect of increasing
   the margin in a colour. Is there such a thing as a coloured spacer I could use
   instead of my adding an empty coloured paragraph, as that trick gives me the 
   extra margin in the colour but I have no control over its depth.
 * I am finding that I do not need a zero margin when the paragraph has a white 
   background. Could I use a CSS to only apply a zero margin on a paragraph block
   if it has no background colour.
 * My hacks work and I am pleased with the result but is my method bad/ making it
   hard work for myself.
    Here is the CSS I placed in my additional CSS. Is there
   a simpler way. Sorry for all the questions.
 *     ```
       p {
        margin-bottom:0!important;
       }
       h1,h2,h3 {
       margin-bottom:0!important;
       }
       .entry-content > *, .wp-block-group > *, .wp-block-columns > * {
           margin-top: 0 !important;
           margin-bottom: 0 !important;
       }
       ```
   

The topic ‘Remove Gaps Between Blocks’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/astra/4.13.2/screenshot.jpg)
 * Astra
 * [Support Threads](https://wordpress.org/support/theme/astra/)
 * [Active Topics](https://wordpress.org/support/theme/astra/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/astra/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/astra/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [generalnumpty](https://wordpress.org/support/users/generalnumpty/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/remove-gaps-between-blocks/)
 * Status: not resolved