IE兼容强制页脚到页面底部的方式? [英] IE compatible way of forcing footer to bottom of page?

查看:74
本文介绍了IE兼容强制页脚到页面底部的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当网页内容的高度小于视口的高度

时,我想强制页脚到底部

视口;而当网页内容的高度

超过视口的高度时,我希望页面底部的页脚是

(所以不是可见,直到你向下滚动到

it)。


我尝试使用 http:// tinyurl中描述的方法.com / 2upa7l 但是它

在IE6或IE5.5中都不起作用(虽然它在IE7中可以正常工作) - 请参阅

我的模拟 http://tinyurl.com/2urjf2 (简短内容)和
http://tinyurl.com/393k5n (长篇内容)。


我的问题是(不幸的是)大约三分之一的用户仍在使用

IE5.5或IE6(参见 http://tinyurl.com/56kp ),因此我预计

的百分比很大我的网站访问者是IE 5.5和6用户。


是否有任何跨浏览器兼容的方式来实现上述

目标?


Dave

Hi
When the height of the content of a webpage is less than the height of
the viewport, I would like to force the footer to the bottom of the
viewport; whereas when the height of the content of the webpage
exceeds the height of the viewport, then I would like the footer to be
at the bottom of the webpage (so not visible until you scroll down to
it).

I tried using the method described at http://tinyurl.com/2upa7l but it
doesn''t work in IE6 or in IE5.5 (although it does work in IE7) - see
my mock-ups at http://tinyurl.com/2urjf2 (short content) and
http://tinyurl.com/393k5n (long content).

My problem is that (unfortunately) around a third of users are still using
IE5.5 or IE6 (see http://tinyurl.com/56kp), and I therefore expect a
large percentage of the visitors to my site to be IE 5.5 and 6 users.

Is there any cross-browser-compatible way of achieving the above
objective?

Dave

推荐答案

当我知道内容获胜时,我所做的只是对页脚使用一种方法增长,当它成长时,我使用不同的方法。在我的情况下,总是很明显使用哪个。如果它是动态的,我就不会想到如何让它在IE中运行。现代浏览器(其他所有东西)都很简单。


忽略IE5 / 5.5。仍然使用这些浏览器的两个人正在考虑放弃计算机。它们也应该用于看起来不正确的网站。
What I have done is just use one method for the footer when I know the content won''t grow, and when it does grow, I use a different method. In my case, it was always obvious which to use. If it was dynamic, I can''t think of how to make it work in IE. Modern browsers (everything else) would be easy though.

Ignore IE5/5.5 . The two people who still use those browsers are thinking of giving up computers. They should also be used to web sites not looking right.



忽略IE5 / 5.5。仍然使用这些浏览器的两个人正在考虑放弃计算机。它们也应该用于看起来不正确的网站。
Ignore IE5/5.5 . The two people who still use those browsers are thinking of giving up computers. They should also be used to web sites not looking right.



尽管拥有IE5.5的用户百分比很小(1.7%),但该百分比所代表的用户数量非常大。这意味着如果我每天有1000名访问者(而且我希望得到更多的访问者),其中17名平均将是IE5.5用户。 IE5.5用户比Opera用户多,而且几乎与Safari用户一样多的IE5.5用户(Mac和Windows组合)。因此,虽然我认为IE5.5用户现在必须使用不适合他们的网站,但考虑到网站的类型,我正在开发(公共和教育),我担心我可以'不能完全忽略它们 - 我希望我能。


因此,如果其他人能想到在IE5.5中实现这一点的方法(即使它意味着使用IE条件评论),我仍然非常感激。


Dave

Although the percentage of users who have IE5.5 is small (1.7%), the number of users which that percentage represents is very large. It means that if I get 1000 visitors a day (and I expect to get a lot more than that), 17 of them on average will be IE5.5 users. There are more IE5.5 users than Opera users, and almost as many IE5.5 users as Safari users (Mac and Windows combined). So while taking your point that IE5.5 users must be used by now to sites not displaying properly for them, given the type of site it is that I''m developing (public, and educational) I''m afraid I can''t afford to completely ignore them - I wish I could.

So if anyone else can think of a way of achieving this in IE5.5 (even if it means using IE conditional comments), I''d still be extremely grateful.

Dave



忽略IE5 / 5.5。
Ignore IE5/5.5 .



除了我在之前的回复中所写的内容,还有一点是我甚至无法在IE6中使用它,而且还有更多的IE6用户比IE7用户还多。


戴夫

In addition to what I wrote in my previous reply, there is also the point that I can''t even get this working in IE6, and there are more IE6 users than there are IE7 users.

Dave


这篇关于IE兼容强制页脚到页面底部的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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