将DIV定位在页面底部 [英] Positioning a DIV at bottom of page

查看:405
本文介绍了将DIV定位在页面底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以定位DIV,使其始终位于屏幕底部的

,而无需使用绝对定位或

使用背景图像变通方法?

谢谢!

Is it possible to position a DIV so that it will always be at the
bottom of the screen without having to use absolute positioning or
using the background image workaround?
Thank you!

推荐答案

2004年5月12日星期三23:00:47 -0500 ,John Smith

< 3r ********* @ sneakemail.com>写道:
On Wed, 12 May 2004 23:00:47 -0500, John Smith
<3r*********@sneakemail.com> wrote:
是否可以定位DIV,使其始终位于屏幕底部,而无需使用绝对定位或
使用背景图片解决方法?
Is it possible to position a DIV so that it will always be at the
bottom of the screen without having to use absolute positioning or
using the background image workaround?




种类。微软不支持它,但它存在。写信给微软和

要求他们修复IE6以支持位置:固定; - 如果有足够的人这样做,

他们可能......



Kind of. Microsoft won''t support it, but it exists. Write to Microsoft and
ask them to fix IE6 to support position: fixed; - if enough people do it,
they might...


2004年5月13日星期四00:37:56 -0400,Neal <是ne ***** @ yahoo.com>写道:


:2004年5月12日星期三23:00:47 -0500,John Smith

:< 3r ******* **@sneakemail.com>写道:



:>是否可以定位DIV以便它始终位于

:>屏幕下方无需使用绝对定位或

:>使用背景图像解决方法?



:种类。微软不支持它,但它存在。写信给微软和

:要求他们修复IE6以支持位置:固定; - 如果有足够的人这样做,

:他们可能会......

这个位置如何不同:绝对?看起来我还是要b $ b仍需要设定最高价值....

On Thu, 13 May 2004 00:37:56 -0400, Neal <ne*****@yahoo.com> wrote:

:On Wed, 12 May 2004 23:00:47 -0500, John Smith
:<3r*********@sneakemail.com> wrote:
:
:> Is it possible to position a DIV so that it will always be at the
:> bottom of the screen without having to use absolute positioning or
:> using the background image workaround?
:
:Kind of. Microsoft won''t support it, but it exists. Write to Microsoft and
:ask them to fix IE6 to support position: fixed; - if enough people do it,
:they might...
How is this different that position: absolute? It looks like I would
still have to set a top value....


2004年5月12日星期三23 :42:26 -0500,John Smith

< 3r ********* @ sneakemail.com>写道:
On Wed, 12 May 2004 23:42:26 -0500, John Smith
<3r*********@sneakemail.com> wrote:
2004年5月13日星期四00:37:56 -0400,Neal< ne ***** @ yahoo.com>写道:

:2004年5月12日星期三23:00:47 -0500,John Smith
:< 3r ********* @ sneakemail.com>写道:

:>是否可以定位DIV以便它始终位于
:>屏幕下方无需使用绝对定位或
:>使用背景图像解决方法?

:有点。微软不支持它,但它存在。写信给微软

:请他们修复IE6以支持位置:修复; - 如果有足够的人这样做,
:他们可能......

这个位置如何不同:绝对?看起来我还是要设置一个最高价值....
On Thu, 13 May 2004 00:37:56 -0400, Neal <ne*****@yahoo.com> wrote:

:On Wed, 12 May 2004 23:00:47 -0500, John Smith
:<3r*********@sneakemail.com> wrote:
:
:> Is it possible to position a DIV so that it will always be at the
:> bottom of the screen without having to use absolute positioning or
:> using the background image workaround?
:
:Kind of. Microsoft won''t support it, but it exists. Write to Microsoft
and
:ask them to fix IE6 to support position: fixed; - if enough people do
it,
:they might...
How is this different that position: absolute? It looks like I would
still have to set a top value....




不。位置:绝对;底部:0;应该将元素放在页面的底部

,无论是在页面上方还是在下方,它都会滚动到

页面。固定不会滚动,它保持不变,使用底部:0;它用作

a页脚在视口的底部。



Nope. position: absolute; bottom: 0; should put the element at the bottom
of the page, whether above the fold or below, and it scrolls with the
page. Fixed won''t scroll, it stays put, and using bottom: 0; it serves as
a "footer" at the bottom of the viewport.


这篇关于将DIV定位在页面底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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