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

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

    This seems to work for me to make a responsive iframe embed with a max height set.

    .embed-container {
        position: relative;
        padding-bottom: min(80vh, 100%);
        width: 100%;
        height: 100%;
        max-height: 80vh;
        overflow: hidden;
        max-width: 100%;
      }
      .embed-container iframe,
      .embed-container object,
      .embed-container embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 80vh;
      }
    
    

提交回复
热议问题