How to make the overflow CSS property work with hidden as value

How to make the overflow CSS property work with hidden as value

Ok if anyone else is having this problem this may be your answer:

If you are trying to hide absolute positioned elements make sure the container of those absolute positioned elements is relatively positioned.

Actually…

To hide an absolute positioned element, the container position must be anything except for static. It can be relative or fixed in addition to absolute.

How to make the overflow CSS property work with hidden as value

Evidently, sometimes, the display properties of parent of the element containing the matter that shouldnt overflow should also be set to overflow:hidden as well, e.g.:

<div style=overflow: hidden>
  <div style=overflow: hidden>some text that should not overflow<div>
</div>

Why? I have no idea but it worked for me. See https://medium.com/@crrollyson/overflow-hidden-not-working-check-the-child-element-c33ac0c4f565 (ignore the sniping at stackoverflow!)

Leave a Reply

Your email address will not be published.