tags:

views:

60

answers:

1

keeping a DIV at the top and center of the page with ability change size div like loading box in Gmail?

+2  A: 

As I said, your question is extremely hazy but I guess you are looking to place a DIV at a fixed position that stays there even when the page is scrolled.

The CSS way to do this is

<div style="position: fixed; top: 0px; left: 0px;">....</div>

won't work in IE < 7. The only way to make this work in IE6, as far as I know, is kludgy and jittery JavaScript-based workarounds.

Pekka
+1 - These are the kinds of things we were able to greatly simplify after getting the go ahead to slap a "IE6 won't work here" on the front page :)
Nick Craver
There is some trick doing this in IE6 without JS, but you really don't want to mess up your hole CSS just to have that effect in IE6.
Kau-Boy
It's not that difficult in IE6, you can put the all contents in a `<div>` with 100% height and width and put the box at the top in another `<div>`; see [my answer to this question](http://stackoverflow.com/questions/2857412/ie6-frame-layout-with-100-height-and-scrollbars/2858341#2858341).
Marcel Korpel
@Marcel - We have a watermark logo in the background, which complicates things in IE6 with your code...fortunately I don't have to spend any more time figuring out how to make something work in IE6. It's a tremendous resource drain; your solution involves changing my layout for everyone else to suit IE6, which is 100% the wrong direction in my case. I was able to simplify so much of our layout when removing the elements/structure specifically there to support IE6 it's ridiculous.
Nick Craver