XF 2.3 Remove bottom space from attachments

PhineasD

Well-known member
Licensed customer
How can I remove this bottom space that's applied by default to all attachments? I've tried margin-bottom:0px but it doesn't work.

1762152205997.webp
 
The margin-bottom: 0px probably isn't working because the space comes from padding on the attachment container rather than a margin on the image itself.

Try targeting the attachment container in your extra.less:

Code:
.bbImageWrapper {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

If that doesn't catch it, the spacing might be on the parent .bbCodeBlock--attachBinary element instead:

Code:
.bbCodeBlock--attachBinary {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

To find the exact element causing the space, right-click on the gap area, choose "Inspect", and look at which element has the margin or padding applied. The browser's box model diagram (bottom of the Styles panel) makes it easy to spot.

One thing to keep in mind — if these are inline attachments inserted into the post body, the spacing might be coming from a <p> or <br> tag added by the editor rather than actual CSS on the attachment.
 
Back
Top Bottom