如何使< div>总是全屏? [英] How to make a <div> always full screen?

查看:102
本文介绍了如何使< div>总是全屏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论其内容如何。

是否可以这样做?

推荐答案

这对我始终有效:

<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
        html, body {
            height: 100%;
            margin: 0;
        }

        #wrapper {
            min-height: 100%; 
        }
    </style>
    <!--[if lte IE 6]>
    <style type="text/css">
        #container {
            height: 100%;
        }
    </style>
    <![endif]-->
</head>

<body>
    <div id="wrapper">some content</div>
</body>

这可能是解决这个问题的最简单的方法。只需要设置四个CSS属性(虽然其中一个只是使愚蠢的 IE快乐)。

This is probably the simplest solution to this problem. Only need to set four CSS attributes (although one of them is only to make stupid IE happy).

这篇关于如何使&lt; div&gt;总是全屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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