How to add or remove blank space between WordPress blocks

How to add or remove blank spaces in WordPress

One way to add or remove blank space between WordPress blocks is by adding custom CSS code to your theme.

So, let’s dive in. You will start by opening up the page or post you want to edit and click on the block where you want the space to be added or removed.

Go to the right hand option menu and click on “Block”. Scroll down, expand the “Advance” submenu, and look for the “Additional CSS class(es)”.

(Click to enlarge)

Now, in the “Additional CSS class(es)”, add the next code:

(Click to enlarge)

This code is going to create a new CSS class for that block.

After doing this, hit “Update” in order to save your new changes.

To continue, go to your WordPress Dashboard, and click on Appearance > Customize.

(Click to enlarge)

Once you’ve opened the editor, click on “Additional CSS”.

(Click to enlarge)

Once you clicked on “Additional CSS”, a new field will be opened where you will be able to add CSS code.

In the newly opened field write the following piece of code:

(Click to enlarge)

So, as I wrote in the image above, by setting the margin-bottom to zero, you will be removing the blank space of the block.

This piece of code works when you want to add more blank space to your block. In that case, the margin-bottom will not be zero anymore, but it will have a value.

It will be something like this:

(Click to enlarge)

Leave a Reply

Your email address will not be published.