Can we define min-margin and max-margin, max-padding and min-padding in css?

后端 未结 19 1805
情话喂你
情话喂你 2021-01-31 01:01

Can we define min-margin and max-margin, max-padding and min-padding in CSS ?

19条回答
  •  爱一瞬间的悲伤
    2021-01-31 01:47

    Try using the css properties min and max as a workaround

    For example:

    width: min(50vw, 200px);

    means the width will be the smallest of the two values.

    width: max(50vw, 200px);

    means the width will be the larger of the two values.

    More details here:

    https://developer.mozilla.org/en-US/docs/Web/CSS/min

提交回复
热议问题