Hi @amiraria,
The Columns block doesn’t support custom gap values in Core yet – you need the Gutenberg plugin active for that. You can also insert the CSS below:
.wp-container-4.has-gap.wp-block-group.alignwide > .wp-block-columns { --wp--style--columns-gap: 0; }
It would be better if you add a custom class to the columns blocks that should be without the gap, and apply the CSS above to that class.
Let me know if it works.
— Anders
I tried to add a custom class to the block, and use the code above but still no result.
.main-page-projects {
--wp--style--columns-gap: 0;
}
@amiraria As far as I can tell from inspecting the page, the custom class isn’t applied to the columns blocks.
I added a background to custom class for you to see that is working.
.main-page-projects {
--wp--style--columns-gap: 0;
background: gray;
}
@amiraria I searched for the class in the markup, and I can see the <style> with the CSS, but the class is not applied to any elements for me. Searching for it in the HTML of the page only gives the one result (in the CSS).
Could you check it one more time? I add two (2) at the end of the custom class.
.main-page-projects-2 {
--wp--style--columns-gap: 0;
background: gray;
}
@amiraria Do you know how to add a custom class to a block? You can find instructions here: https://themesharbor.com/add-css-class-to-wordpress-block/
Yes, of course. I’m following exactly as it’s on the instruction.
Check this image:
https://www.dropbox.com/s/m8o8q8z9tyrv9qi/Custom-1.png
-
This reply was modified 4 years, 2 months ago by
amiraria.
By adding a custom class to both columns (top and bottom) and using this code my problem is solved now.
.main-page-projects {
margin-top: 0!important;
margin-bottom: 0!important;
}
I find it from a replay on this thread:
https://ww.wp.xz.cn/support/topic/reduce-space-between-blocks/page/2/#post-13993399