I’m new to WordPress and site building in general. I heard that 6.6 is going to release in a couple weeks and bring negative margin support to the Gutenberg block editor but, man, I can’t wait for that really, I need to finish this website as soon as possible.
I’ve researched online that you can currently make negative margins through plugins, but I’m trying to use as little plugins as possible to reduce my dependency and cut off the bloat. I heard you can use negative margins with theme.json but there are no direct explanations on how. I also heard that you can make a CSS class and use that on an individual block, but I did that and it isn’t affecting my block.
I gave this one group block the class, “custommargin1”, and then made an additional CSS in the Styles section,
`custommargin1 {`
`margin-top: -7.17em;`
`}`
However this doesn’t work. Can anyone help me out?
[ad_2]
If that’s exactly how your code looks then you are missing the “.” Before the class name
.custommargin1 {
margin-top: -7.17em;
}
Install the WordPress Beta Tester plug-in and upgrade your WP to the 6.6 release candidate version, it is pretty much the same version they will launch this month. The you can use the UI to apply the negative margins right now.
What are you trying to do exactly? There’s rarely a good reason to use negative margins. Can you share the URL of the page?