By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 1,952 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Positioning a DIV at bottom of page

P: n/a
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!

Jul 20 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
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...
Jul 20 '05 #2

P: n/a
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....

Jul 20 '05 #3

P: n/a
On Wed, 12 May 2004 23:42:26 -0500, John Smith
<3r*********@sneakemail.com> wrote:
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....


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.
Jul 20 '05 #4

P: n/a

"John Smith" <3r*********@sneakemail.com> wrote in message
news:si********************************@4ax.com...
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!


Set division1 to a fixed height larger than you'll ever need.
Set division2 directly below it.
do all of your layout work in division 1.

<division1>
<division3>yada yada</division3>
<division4>qwerty</division4>
</division1>
<division2>blah blah</division2>


Jul 20 '05 #5

P: n/a
On Wed, 12 May 2004 23:38:47 -0500, Richard <An*******@127.001> wrote:

"John Smith" <3r*********@sneakemail.com> wrote in message
news:si********************************@4ax.com...
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!


Set division1 to a fixed height larger than you'll ever need.
Set division2 directly below it.
do all of your layout work in division 1.

<division1>
<division3>yada yada</division3>
<division4>qwerty</division4>
</division1>
<division2>blah blah</division2>


How will that put it at the bottom of the screen? It might very well not
reach the bottom of the screen, or be lower so I have to scroll to get to
it.
Jul 20 '05 #6

P: n/a
Neal 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...


True. But there are some work-arounds, for IE's lack of support for {
position: fixed }. There are separate work-arounds for IE 5 & IE 6. I think I
read about them here.

I used the following extra CSS for one page. I used a conditional comment in
the head block so that only IE saw this. It overrode the "fixed" value of one
of the rules seen by other browsers. It only works for certain of the
elements, I think. (And is *not* a substitute for IE doing things right!)

html {
overflow: hidden;
}
body {
height: 100%;
overflow: auto;
}
..someclass {
position: absolute;
}

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #7

P: n/a
On Thu, 13 May 2004 00:56:51 -0400, Neal <ne*****@yahoo.com> wrote:

:On Wed, 12 May 2004 23:42:26 -0500, John Smith
:<3r*********@sneakemail.com> wrote:
:
:> 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....
:
: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.

This works great expect when the page scrolls. Is there a workaround
for that?

Jul 20 '05 #8

P: n/a
"Barry Pearson" <ne**@childsupportanalysis.co.uk> writes:
Neal wrote: I used the following extra CSS for one page. I used a conditional
comment in the head block so that only IE saw this.


Neal,

I understand your general point, but wondered about "conditional
comment." Don't EI and Mozilla respond to a comment in the header
style the same way?

--
Haines Brown

Jul 20 '05 #9

P: n/a
Els
Haines Brown wrote:
"Barry Pearson" <ne**@childsupportanalysis.co.uk> writes:
Neal wrote:

I used the following extra CSS for one page. I used a conditional
comment in the head block so that only IE saw this.


Neal,

I understand your general point, but wondered about "conditional
comment." Don't EI and Mozilla respond to a comment in the header
style the same way?


It's Barry who mentioned the conditional comment, not Neal ;-)

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #10

P: n/a
On Thu, 13 May 2004 17:28:46 GMT, Haines Brown
<br****@teufel.hartford-hwp.com> wrote:
"Barry Pearson" <ne**@childsupportanalysis.co.uk> writes:
Neal wrote:

I used the following extra CSS for one page. I used a conditional
comment in the head block so that only IE saw this.


Neal,

I understand your general point, but wondered about "conditional
comment." Don't EI and Mozilla respond to a comment in the header
style the same way?


That was Barry. Watch the attributions.
Jul 20 '05 #11

P: n/a
Thank you everyone for your responses. I have achieved my goal. You
can take a look at the results at http://rhpt.com/default.view. I ask
that if you do go to the URL, please use Netscape/Mozilla/Firefox and
let me know if the bottom footer doesn't stay at the bottom.

Now, does anyone know how to make a DIV stretch the length of the page
in Gecko based browsers without resorting to the "repeat background
image" trick ... ?

Jul 20 '05 #12

P: n/a
Els wrote:
Haines Brown wrote:
"Barry Pearson" <ne**@childsupportanalysis.co.uk> writes: [snip]
I used the following extra CSS for one page. I used a conditional
comment in the head block so that only IE saw this.


Neal,
I understand your general point, but wondered about "conditional
comment." Don't EI and Mozilla respond to a comment in the header
style the same way?


It's Barry who mentioned the conditional comment, not Neal ;-)


I've lost track of who is asking what of whom!

There are ways to put conditional comments in the head-block so that (as far
as I know) only IE will take action. All other browsers will treat them as the
comments they are. I've seen references to the material on the MS site, but I
can't find the reference at the moment.

Example, from a head-block:

<!--[if IE]>
<link href="exhibit05_ie.css" rel="stylesheet" type="text/css">
<![endif]-->

This will cause IE, and no other browser, to use exhibit05_ie.css in the
cascade. See, for example, the following page. In non-IE browsers it takes the
cells of a table and uses { position: fixed } to stick them to the corners &
sides of the viewport. But IE doesn't support { position: fixed }, so a
work-around it needed. This page uses a tricky combination of html & body
rules & { position: absolute }. And then, even in IE, it can stick the cells
of a table to the corners & sides of the viewport.

http://www.barry.pearson.name/articl.../exhibit05.htm

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.