Can we define min-margin
and max-margin
, max-padding
and min-padding
in CSS ?
I think I just ran into a similar issue where I was trying to center a login box (like the gmail login box). When resizing the window, the center box would overflow out of the browser window (top) as soon as the browser window became smaller than the box. Because of this, in a small window, even when scrolling up, the top content was lost.
I was able to fix this by replacing the centering method I used by the "margin: auto" way of centering the box in its container. This prevents the box from overflowing in my case, keeping all content available. (minimum margin seems to be 0).
Good Luck !
edit: margin: auto only works to vertically center something if the parent element has its display property set to "flex".