Results 1 to 6 of 6

Thread: Center Webpage?

  1. #1
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Center Webpage?

    Im trying to center my homepage so its centered verticly and horrizontaly. I want it so you can view the navagation (the stars) in any web resolution so it would be good to center and center the whole page. Its not just an image, it has imagemaps and rollovers so i need it to center everything. If anyone could help! Thanks!

    http://www.dreadedissues.110mb.com for preview

    just view the source code and help me out please! =D
    Last edited by zacory03; 08-31-2007 at 10:27 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    HTML Code:
    <html>
    <head>
    <title></title>
    <style>
    .absolute_center  { 
    position:absolute; 
    width:723px; // width of your div
    height:90px;  // height of your div
    top:50%; 
    left:50%; 
    margin-left:-361.5px;  // width of your dive * -(1/2)
    margin-top:-45px; // height of your div * -(1/2)
    }
    </style>
    </head>
    
    <body>
    <div class="absolute_center">
       MENU CODE
    </div>
    
    </body>
    </html>

    Also add that image as a background image instead of a regular image (to prevent horizontal scrolling).

  3. #3
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    uh thanks but i cant put the image as a background image because it has image maps and rollovers in it. thats kinda the problem

  4. #4
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    but i guess its alright. the code works fine and does what i pretty much wanted it too. Thanks.

  5. #5
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh wait, i have one question. its taking it off from only the bottom, and i need it centered horizontily, and not just taken off of the bottom? if that makes sence. thanks.
    Last edited by zacory03; 08-31-2007 at 09:25 PM.

  6. #6
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    NVM NVM i figured it out, i just had to take away your "// width of your div" and such and now it works, THANK YOU SO MUCH, you dont know how happy and how long ive been trying to figure this out!

Bookmarks

Posting Permissions

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