Board Thread:Support Requests - Designing Your Wiki/@comment-1807002-20190822000529/@comment-9605025-20190822222509

I think it is because the header margins are set using "em" units which adjusts with "font-size" which Wikia adjusts based on screen size. Instead, you can adjust the margins of the gallery itself to be 0 and the bottom margin of the headers to be 0. That should always put the two flush. The specifics on how to do that depends on whether or not you want to do it for all headers and galleries across the wiki or just the ones in this template.