子层没办法得到父层的高度 parent (max-height), child (height:100%)

链接: https://stackoverflow.com/questions/14262938/child-with-max-height-100-overflows-parent

 

解释说不行的原因是子层没有办法知道具体的高度, 所以会进可能的大...

原理我不知道, 要读 W3C 才有结果....

 

目前的 workaround 是给父层 display:flex, 孩子就会有 height:100%

posted @ 2021-02-03 10:45  泉油  阅读(187)  评论(0编辑  收藏  举报
Web Design Johor Bahru Malaysia - Stooges