CSS:percent min-height元素嵌套在percent min-height元素中 [英] CSS: percent min-height element nested within percent min-height element

查看:302
本文介绍了CSS:percent min-height元素嵌套在percent min-height元素中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让html,body和wrapper元素都具有100%的最小高度,以覆盖整个查看窗口,但我发现我只能使html遵守此声明。

I would like to make the html, body and wrapper elements all have a minimum height of 100% in order to cover the whole viewing window, but I have found that I can only make html obey this declaration.

html, body, #wrapper {
        min-height:100%;
        }

html {
        border: 2px red solid;
        }

body{
        border: 2px blue solid;
        }

#wrapper {
        border: 2px pink dotted;
        }

创建一个只有#wrapper div的简单html文档,在它或不。如果使用最小高度的像素,元素服从它,但是当我使用百分比只有html将工作。为什么是这个?

Create a simple html document with only a #wrapper div which can either have content in it or not. If a min-height of pixels is used, the elements obey it, but when I use percentages only html will work. Why is this?

推荐答案

这肯定会帮助你...

This will definitely help you...

http://www.cssstickyfooter.com/using-sticky-footer-code .html

这篇关于CSS:percent min-height元素嵌套在percent min-height元素中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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