HTML & CSS · Senior · Question 13 of 75
How does overflow: clip differ from overflow: hidden?
- ✓Correct answer:
clipclips without creating a scroll container and doesn't breaksticky - 2
clipclips only horizontally, whilehiddenclips on both axes - 3They're synonyms:
clipis just a new spelling of the same value
Explanation
overflow: hidden makes the element a scroll container (it can be scrolled programmatically), so sticky descendants start sticking to it. clip simply clips painting, forbids any scrolling and doesn't create a BFC. Axes can be controlled separately (overflow-x: clip), and a clip margin can be set with overflow-clip-margin.