An element should become invisible, but the layout space it occupies needs to stay in place.
⚡ Quick Fix (TL;DR)
The Culprit: display: none removes an element from the layout entirely, which can cause everything around it to shift.
The Fix: Hide the element visually while preserving its space in the layout – the key difference from display: none, which removes the element from the layout entirely rather than just hiding it in place.
.my-element {
visibility: hidden;
}
Rather not untangle this yourself? Our Done-For-You team handles exactly this kind of thing, start to finish.
See DFY options →
Was this helpful?
Thanks for the feedback!
Tagged in :