Ok but I thought “display: none;” was keeping the rendering of the H2 bc
the blocks moved, not with “visibility: hidden;”.
Anyway, thanks.
A user wants to hide an H2 title in a Shopify section using visibility: hidden CSS.
Solution provided:
h2 { visibility: hidden !important; } to hide the element while preserving its space (padding, margin remain)h2 { display: none !important; } to completely remove the element from the page flowKey distinction:
visibility: hidden keeps the element’s layout space, leaving a blank gapdisplay: none removes the element entirely, causing other blocks to shift upThe original poster confirmed understanding that display: none removes rendering, not visibility: hidden.
Follow-up question:
Another user asked how to apply this to collection titles on a collection compilation page. They tried .collection.title { visibility: hidden !important; } but it didn’t work—this remains unresolved.
Ok but I thought “display: none;” was keeping the rendering of the H2 bc
the blocks moved, not with “visibility: hidden;”.
Anyway, thanks.