Grandma Marni’s price board with too much writing: set overflow per axis, and the browser answers the values it really uses, how far the writing spills, the…
overflow is in every scroll panel, modal, carousel and card with long text. Pick the wrong value and the content leaks over other elements, or empty scrollbars show up everywhere. The side effects matter too: any value other than visible and clip makes the element a scroll container, which holds in child margins and anchors position: sticky.
overflow only acts when the content is bigger than the box, and each axis can differ
visible lets content overflow and paints it over its neighbours. Use hidden/clip to clip it, or auto to make it scroll.overflow: scroll shows an empty scrollbar even when the content fits scroll always draws a scrollbar (on systems where scrollbars take room). Use auto so it shows only when the content overflows.height or max-height. Without one the box just grows with its content, so nothing overflows.overflow-x: visible + overflow-y: auto, yet the content is still cut at the side When one axis scrolls, visible on the other computes to auto. A dropdown or tooltip that must stick out of a scroll panel has to live outside the panel (or use position: fixed/popover).hidden, then auto hidden clips with no scrollbar; auto draws a scrollbar because the content overflows. Watch the scrollbar numbers.el.scrollTop += 40 with overflow: hidden, then with overflow: clip hidden scrolls although it has no scrollbar; clip stays put. The difference only shows from script. Set both axes: clip next to hidden computes to hidden.overflow-x: visible and overflow-y: auto The browser computes overflow-x as auto: the content does not leak sideways, it gets a sideways scroll instead.overflow-y: auto The board grows with its content, so nothing overflows and nothing scrolls.