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

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

    You can also use @media queries to establish your max/min padding/margin (but only according to screen size):

    Let's say you want a max padding of 8px, you can do the following

    div {
      padding: 1vh 0;
    }
    @media (max-height: 800px) {
      div {
        padding: 8px 0;
      }
    }
    

提交回复
热议问题