开发者

Height: 100% inside min-height: 100%

开发者 https://www.devze.com 2022-12-31 09:47 出处:网络
How would you get a height: 10开发者_如何学Go0% inside a min-height: 100% working?I usually use:

How would you get a height: 10开发者_如何学Go0% inside a min-height: 100% working?


I usually use:

position: absolute;
height: 100%;

And on the outer div:

position: relative;
min-height: 100%;

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消