拉伸div填充身体 [英] stretching div to fill body

查看:64
本文介绍了拉伸div填充身体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html style="margin:0px 0px 0px 0px;padding:0px 0px 0px 0px;">
    <body style="height:100%;width:100%;">
        <div style="height:20px;background-color:red;"></div>
        <div style="background-color:black;"></div>
        <div style="height:20px;background-color:blue;"></div>
    </body>
</html>

如何使第二个div伸展以填充体内的剩余空间(放置第一个和第三个div之后)?

How can I make the second div stretch to fill remaining space (after placing the first and third div) in the body?

推荐答案

如果您想要粘贴页脚系统,请使用以下技术:

If you want the stick footer system, then use this technique:

* {
    margin: 0;
}

html, body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -20px;
}

.footer, .push {
    height: 20px;
}

http://ryanfait.com/resources/footer-stick-to-bottom-页面/

这篇关于拉伸div填充身体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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