Place DIV in center of browser window?

Discussion in 'HTML' started by Noozer, Apr 13, 2004.

  1. Noozer

    Noozer Guest

    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!
     
    Noozer, Apr 13, 2004
    #1
    1. Advertising

  2. Noozer

    brucie Guest

    in post: <news:_fIec.93994$Ig.43568@pd7tw2no>
    "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.

    --
    b r u c i e
     
    brucie, Apr 13, 2004
    #2
    1. Advertising

  3. Noozer

    Richard Guest

    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.
     
    Richard, Apr 13, 2004
    #3
  4. Noozer

    Noozer Guest

    "Noozer" <> 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!
     
    Noozer, Apr 13, 2004
    #4
  5. Noozer

    Mark Parnell Guest

    On Tue, 13 Apr 2004 20:38:53 GMT, "Noozer" <> declared
    in alt.html:

    > Thanks guys!


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

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Apr 13, 2004
    #5
  6. Noozer

    Neal Guest

    On Wed, 14 Apr 2004 08:43:08 +1000, Mark Parnell
    <> wrote:

    > On Tue, 13 Apr 2004 20:38:53 GMT, "Noozer" <> declared
    > in alt.html:
    >
    >> Thanks guys!

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



    Richard also replied...
     
    Neal, Apr 14, 2004
    #6
  7. Noozer

    Mark Parnell Guest

    On Tue, 13 Apr 2004 20:11:27 -0400, Neal <> 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
     
    Mark Parnell, Apr 14, 2004
    #7
  8. Noozer

    Neal Guest

    On Wed, 14 Apr 2004 10:20:51 +1000, Mark Parnell
    <> wrote:

    > On Tue, 13 Apr 2004 20:11:27 -0400, Neal <> 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 :)
     
    Neal, Apr 14, 2004
    #8
  9. in post: <news:>
    Mark Parnell <> 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
     
    brucies computer, Apr 14, 2004
    #9
  10. Mark Parnell wrote:

    > On Tue, 13 Apr 2004 20:11:27 -0400, Neal <> 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
     
    Toby A Inkster, Apr 14, 2004
    #10
  11. Noozer

    Mark Parnell Guest

    On Wed, 14 Apr 2004 06:41:52 +0100, Toby A Inkster
    <> declared in alt.html:

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

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Apr 14, 2004
    #11
  12. Noozer

    Els Guest

    Mark Parnell wrote:
    > On Wed, 14 Apr 2004 06:41:52 +0100, Toby A Inkster
    > <> declared in alt.html:
    >
    >>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.


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

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Apr 14, 2004
    #12
  13. Noozer

    Noozer Guest

    "Noozer" <> wrote in message
    news:xdYec.107537$Ig.2218@pd7tw2no...
    >
    > "Noozer" <> 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!


    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?
     
    Noozer, Apr 14, 2004
    #13
  14. Noozer

    Mark Parnell Guest

    On Wed, 14 Apr 2004 09:29:22 +0200, Els <>
    declared in alt.html:

    > Richard uses X-No-Archive: yes.


    So he forces Google to killfile him. :) I don't blame him, really.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Apr 15, 2004
    #14
  15. Noozer

    Els Guest

    Mark Parnell wrote:
    > On Wed, 14 Apr 2004 09:29:22 +0200, Els <>
    > declared in alt.html:
    >
    >>Richard uses X-No-Archive: yes.

    >
    > So he forces Google to killfile him. :) I don't blame him, really.


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

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Apr 15, 2004
    #15
  16. Noozer

    Mark Parnell Guest

    On Thu, 15 Apr 2004 09:36:36 +0200, Els <>
    declared in alt.html:

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

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Apr 19, 2004
    #16
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Parson
    Replies:
    16
    Views:
    52,175
    Kent Paul Dolan
    Nov 24, 2005
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    812
  3. CaptCaveman1

    Place div beneath another div

    CaptCaveman1, Feb 6, 2011, in forum: HTML
    Replies:
    2
    Views:
    801
    richard
    Feb 6, 2011
  4. Replies:
    3
    Views:
    168
    Richard Cornford
    May 13, 2005
  5. Gernot Frisch

    center div over another div

    Gernot Frisch, Mar 16, 2006, in forum: Javascript
    Replies:
    1
    Views:
    202
    Randy Webb
    Mar 16, 2006
Loading...

Share This Page