Can we define min-margin
and max-margin
, max-padding
and min-padding
in CSS ?
I was looking for a solution to make the contents of a row behave like in a fixed width container, but with shrinking browser width make a minimal margin from the left (in my case: so that the row contents do not hide under a big logo with position: absolute
in left-top).
This is what worked for me:
HTML
Some header
CSS
.parent-container {
padding-left: min(150px);
}
.child-container {
padding-left: calc( 50vw - 500px );
}
When I scale the browser window left and right, my h1
doesn't go to the left more than the 150px
, but goes right following the behavior of my next row's content set to display in a fixed container.