Place DIV in center of browser window?

N

Noozer

Just wondering how to place a fixed size DIV in the center of the browser
window. If the browser is resized I'd like the DIV to adjust it's position.
I also do not want the DIV to scroll with the background/content.

Thx!
 
B

brucie

in post: <
Noozer said:
Just wondering how to place a fixed size DIV in the center of the browser
window. If the browser is resized I'd like the DIV to adjust it's position.
I also do not want the DIV to scroll with the background/content.

/* center <div> for IE*/
div{width:500px;margin:auto;}

/* position div for browsers that have a clue*/
div,[nul]{left:50%;margin:0;margin-left:-250px;position:fixed;}

position:fixed; not supported by IE. behavior buggy with window widths
less than <div> width in moz1.6. fine in opera7.23.
 
R

Richard

Noozer said:
Just wondering how to place a fixed size DIV in the center of the browser
window. If the browser is resized I'd like the DIV to adjust it's
position. I also do not want the DIV to scroll with the
background/content.

..box {margin:10%;}

Do not specify a width and it will adjust accordingly.
To my knowledge, only the background can be made stationary.
 
N

Noozer

Noozer said:
Just wondering how to place a fixed size DIV in the center of the browser
window. If the browser is resized I'd like the DIV to adjust it's position.
I also do not want the DIV to scroll with the background/content.


Thanks guys!
 
M

Mark Parnell

Richard also replied...

Ah, fair enough. I have him killfiled. Though I did check in Google
first, and only brucie's showed up. Guess I should have waited a bit.

I still maintain brucie has multiple personalities, though. ;-)
 
N

Neal

Ah, fair enough. I have him killfiled. Though I did check in Google
first, and only brucie's showed up. Guess I should have waited a bit.

I still maintain brucie has multiple personalities, though. ;-)


This I cannot contest :)
 
T

Toby A Inkster

Mark said:
Ah, fair enough. I have him killfiled. Though I did check in Google
first, and only brucie's showed up.

Perhaps Google have killfiled him too?
 
M

Mark Parnell

Perhaps Google have killfiled him too?

LOL. Could be - everything else in the thread except your post (and this
one of course) show there now, but Richard's still isn't there.
 
E

Els

Mark said:
LOL. Could be - everything else in the thread except your post (and this
one of course) show there now, but Richard's still isn't there.

Richard uses X-No-Archive: yes.
Meaning his posts won't be archived.
 
N

Noozer

Noozer said:
Thanks guys!

For what it's worth, I've got a sample of my result posted...

http://dev.csd.ca/sale

I know it ain't perfect, but please let me know what you think of the
layout. There is some fine tuning I want to do, but I'll try and figure it
out before asking.

I do have one question... In FireFox 0.8, why don't the links in the header
menu work?
 
M

Mark Parnell

(though I wonder if he's aware that 'no-archive: yes'
doesn't mean yes-archive)

Possibly not. X-archive: no is a lot more logical than X-no-archive:
yes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top