The idea
contain: size tells the browser to size an element as if it had no children at all. The box's height — which would normally grow to fit its content — collapses to zero, even though the child is still there and still visible.
height (and min-height/max-height) are off-limits: setting height: 0 would collapse the box without teaching you that contain: size ignores its children.