高度:100%内部最小高度:100% [英] Height: 100% inside min-height: 100%

查看:158
本文介绍了高度:100%内部最小高度:100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得高度:100%在最小高度内:100%工作?

How would you get a height: 100% inside a min-height: 100% working?

推荐答案

position: absolute;
height: 100%;

而在外部div:

position: relative;
min-height: 100%;

使用静态定位无效,因为浏览器需要外部div的高度来计算内部div高度。但它不知道外div的高度,直到它已经计算了内div的...

Using static positioning doesn't work, because the browser needs the outer div's height to calculate the inner div's height. But it doesn't know the outer div's height until it has calculated the inner div's...

但是,我的解决方案不能在许多情况下使用。也许别人有一个更好的。

However, my solution can't be used in many situations. Maybe someone else has a better one.

这篇关于高度:100%内部最小高度:100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆