XF 2.1 Trying to remove space between 2 widgets

beerForo

Well-known member
I know how to modify the margin space of widgets in What's New, but there's one widget where I want 0 spacing below or above so it touches the other. Any way to do this? Thanks
 
Last edited:
You'll need to inspect the widget to find this snippet:

Screenshot_5.png

Then you can use some simple CSS inside the template: extra.less to remove the margin.
Code:
.block[data-widget-key="whats_new_new_posts"] { margin-bottom: 0; }
 
@Russ I wonder why it won't control margin-top? Even with !important;

It's not a big deal, I just used your code for the top widget, not the bottom one, and they touch now, thanks!
 
@Russ I wonder why it won't control margin-top? Even with !important;

It's not a big deal, I just used your code for the top widget, not the bottom one, and they touch now, thanks!

It will if the value is greater than the margin-bottom of the element above it. For instance... the block above it has 20px margin-bottom, the block directly below it would need to have at least 21px margin-top to show an actual change.
 
Top Bottom