CSS - position: absolute; - auto height

后端 未结 8 2105
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 16:46

I am having a problem with some div\'s

The outer div has a min-height, but the inner divs are all varying heights. Because the inner divs are absol

8条回答
  •  醉话见心
    2020-12-15 17:31

    Maybe u can try max-height: calc(100% - 50%); it will work if the content that should be in the middle of the screen/div is super short/small.

    position:absolute;
    top:0;
    bottom:0;
    margin:auto;
    width:auto;
    height:auto
    max-height: calc(100% - 50%);
    ...etc...
    

提交回复
热议问题