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

后端 未结 19 1493
情话喂你
情话喂你 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:38

    @vigilante_stark's answer worked for me. It can be used to set a minimum "approximately" fixed margin in pixels. But in a responsive layout, when the width of the page is increasing margin can be increased by a percentage according to the given percentage as well. I used it as follows

    example-class{
      margin: 0 calc(20px + 5%) 0 0;
    }
    

提交回复
热议问题