Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Place DIV in center of browser window?

Reply
Thread Tools

Place DIV in center of browser window?

 
 
Noozer
Guest
Posts: n/a
 
      04-13-2004
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!


 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      04-13-2004
in post: <news:_fIec.93994$Ig.43568@pd7tw2no>
"Noozer" <(E-Mail Removed)> 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.

--
b r u c i e


 
Reply With Quote
 
 
 
 
Richard
Guest
Posts: n/a
 
      04-13-2004
Noozer wrote:

> 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!


..box {margin:10%;}

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


 
Reply With Quote
 
Noozer
Guest
Posts: n/a
 
      04-13-2004

"Noozer" <(E-Mail Removed)> wrote in message
news:_fIec.93994$Ig.43568@pd7tw2no...
> 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!


 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      04-13-2004
On Tue, 13 Apr 2004 20:38:53 GMT, "Noozer" <(E-Mail Removed)> declared
in alt.html:

> Thanks guys!


Guy*s*? I always knew brucie had multiple personalities.

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
Neal
Guest
Posts: n/a
 
      04-14-2004
On Wed, 14 Apr 2004 08:43:08 +1000, Mark Parnell
<(E-Mail Removed)> wrote:

> On Tue, 13 Apr 2004 20:38:53 GMT, "Noozer" <(E-Mail Removed)> declared
> in alt.html:
>
>> Thanks guys!

>
> Guy*s*? I always knew brucie had multiple personalities.
>



Richard also replied...
 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      04-14-2004
On Tue, 13 Apr 2004 20:11:27 -0400, Neal <(E-Mail Removed)> declared
in alt.html:

> 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.

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
Neal
Guest
Posts: n/a
 
      04-14-2004
On Wed, 14 Apr 2004 10:20:51 +1000, Mark Parnell
<(E-Mail Removed)> wrote:

> On Tue, 13 Apr 2004 20:11:27 -0400, Neal <(E-Mail Removed)> declared
> in alt.html:
>
>> 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.
>



This I cannot contest
 
Reply With Quote
 
brucies computer
Guest
Posts: n/a
 
      04-14-2004
in post: <news:(E-Mail Removed)>
Mark Parnell <(E-Mail Removed)> said:

> I still maintain brucie has multiple personalities, though.


thats a lie!


--
b r u c i e s c o m p u t e r


 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      04-14-2004
Mark Parnell wrote:

> On Tue, 13 Apr 2004 20:11:27 -0400, Neal <(E-Mail Removed)> declared
> in alt.html:
>
>> Richard also replied...

>
> 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?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Place div beneath another div CaptCaveman1 HTML 2 02-06-2011 04:16 AM
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
center div over another div Gernot Frisch Javascript 1 03-16-2006 01:42 PM
NS/FF don't change div offsetWidth when div innerHTML is added toand div becomes wider mscir Javascript 3 06-26-2005 04:04 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM



Advertisments