Perhaps the only difference when using hidden is the unintended consequence of hiding content if the parent has a fixed height
This is css community fundamentals. It works “perfectly”, but make sure your height is not specified. Oh, and don’t change the container type. And with time it all depends more and more on other hacks, until your layout turns into a knot of hacks and cross-sectional assumptions smeared all across the “codebase”.
And then you ought to make fully isolated non-leaky components with it. I mean, you can’t, but here’s a hack to make them fit together. I mean, in this particular case, wow thank god the container is already position absolute.
The seeming complexity here is because people refuse to learn the box model, so they learn all sorts of incantations and guess at what they need to do: https://developer.mozilla.org/en-US/docs/Learn_web_developme...
And yes, C is a pile of crap too. I programmed in it for 15 years.
This contrasts to every modern language, regardless of declarative or not, where to get the effect you import it explicitly into a chunk/block/component/etc.
If css was C, it could add “unsigned” to every first int variable in a function that goes after a typedef. Which was part of “aspect oriented programming”, which was deemed an absurdly bad practice, to put it simply.