Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jan 2005
    Location
    West Midlands, United Kingdom
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question *Help centering *

    Hey guys,

    i'm working on a page and i want the page to be centred when the user maximises it. Because at the moment it looks a bit pap being stuck in the left part of the page.

    The problem is i'm working with a lot of layers.
    So i'm wondering if i could group all the layers into one layer and define a css class for it. However i've tried doing that with no joy , so i'm open to suggestions

    Many thanks,

    Al.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    umm the code or a link would be nice but just a quick suggestion without actually seeing the code, put all of your content inside a div tag and use margin:auto; for just that div, if u have a valid doctype on your page it should work in IE and will work in other browsers also

  • #3
    New Coder
    Join Date
    Jan 2005
    Location
    West Midlands, United Kingdom
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    should've really mentioned i'm working with dreamweaver too.... got div tags flying everywhere, thing is they're using absolute positioning. As you can see i'm about what i'm trying to accomplish.

    As soon as i tried making a div to cover the page it just made a tiny rectangle and moved that . hope this clarifies the level i'm working at.

    thanks,
    al.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    without any of ur code no one can really help you, but using absolute positioning will make things tough may have to just scrap the positioning and layout your page differently so it would be possible to center it

  • #5
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    I suggest you leave the "what you see is wat you (hope to) get" mode of Dreamweaver and enter the coding mode, or use a decent text coding program like Homesite or something

    That being said, its good to realize how position:absolute and position:relative actually works so that you better understand when to use what.

    The following link will take you to the developer center of Microsoft who have a good explanation and example ready for you. After reading that (took me couple times....) you will make no more mistakes and find that centering page will be a breeze, even with everthing in layers.

    Microsoft Online html Library

    Good luck and let us know if it worked for you

  • #6
    New Coder
    Join Date
    Jan 2005
    Location
    West Midlands, United Kingdom
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just reading through that info now, i'll let you know if i get stuck

    thanks again people,


    Al.

  • #7
    New Coder
    Join Date
    Jan 2005
    Location
    West Midlands, United Kingdom
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Managed to make some progress, you're gonna kill me for saying it , i've managed to get that right on template (i think anyway).

    However the page i'm working with has layers too, can i link those divs to the parent of the template, or would i have to create another parent on that page?

    Many thanks,

    Al.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    code plz...

  • #9
    New Coder
    Join Date
    Jan 2005
    Location
    West Midlands, United Kingdom
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks people i've still got no idea about the rest of the page... i started another topic on this tho...should've put it on the end of this one "DOH!"

    Thanks again,
    Al.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •