使脚本使用css的remianing底部空间 [英] Make footer take remianing bottom space using css

查看:110
本文介绍了使脚本使用css的remianing底部空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让我的页脚采取与剩余底部相同的高度。目前我使用以下css作为页脚:

I want my footer to take height same as the remaining bottom space. Currently I'm using following css for footer:

clear: both;
float: left;
background-color: #1F1102;
color: #E4F2FA;
min-height: 60px;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
padding: 0;
padding-top: 10px;
text-align: left;
width: 100%;
min-width: 1000px;
margin: auto;

结果是:

在这里可以看到黑色只需要最小高度。我想要它采取整个剩余的空间后它[标有问号]。

Here as you can see the black has take only minimum height. I want it to take whole remaining space after it [that is marked with question marks]. Which changes do I have to make to get this?

注意: - 我不想给予 position:fixed

note:- I don't want to give position:fixed to make it stick to bottom.

推荐答案

好的,简短的答案是,你不能! / strong>

更长的答案?你可以伪造它。

Well, the short answer is, You Can't!
The longer answer? You can fake it.

因为块级元素不能

使用与页脚相同的背景颜色对于容器(或相同的背景图片),这将导致出现,它总是填满整个空间。

Use the same background color as the footer for the container (or the same background image), that will cause it to appear like it's always fills up the entire space.

这篇关于使脚本使用css的remianing底部空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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