Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Feb 2004
    Posts
    46
    Member #
    5013
    Well I'm having trouble centering my site. I searched through some of the topics that have this problem but they don't really help. I tried to set my right and left margins for my div that wraps around all my other divs but that doesn't work. The best I can do is make it center on people with high resolution but people at 800 x 600 have to scroll horizontal to see the entire site.

  2.  

  3. #2
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    Slap a <div align="center"></div> around your code....

  4. #3
    Member
    Join Date
    Mar 2004
    Posts
    40
    Member #
    5208
    This code makes it work - wrap the 'container' div tags around all the rest of your code. You may need to modify the width/height settings to match your sites dimansions:

    --------------------------------

    body {
    font-family: Arial, Helvetica, sans-serif;
    margin:1px 0px;
    padding:0px;
    text-align: center;
    background-color: efefef;
    }

    #container {
    height: 600px;
    width: 800px;
    background-color: CC0003;
    text-align:left;
    border:1px solid #666666;
    position: relative;
    margin-left:auto;
    margin-right:auto;

    }

  5. #4
    Member
    Join Date
    Mar 2004
    Posts
    40
    Member #
    5208
    People with low resolutions will always have to scroll in order to see the page, unless the site is less than about 790/540 pixels. You will have to design it to make it smaller.

  6. #5
    Member palmer's Avatar
    Join Date
    Aug 2003
    Posts
    33
    Member #
    2439
    Indeed, i wouldn't worry about centering your page on 800x600 res. That would require a very skinny site. 800px width is a decent compromise. And if your site is centered on 1024x768 and higher, you're golden.
    Look to the cookie Elaine....look to the cookie.

    http://www.queuedtalent.com

  7. #6
    Banned
    Join Date
    Dec 2004
    Posts
    7
    Member #
    8374
    hoda nofal romano

    Quote Originally Posted by latinoHt5
    Well I'm having trouble centering my site. I searched through some of the topics that have this problem but they don't really help. I tried to set my right and left margins for my div that wraps around all my other divs but that doesn't work. The best I can do is make it center on people with high resolution but people at 800 x 600 have to scroll horizontal to see the entire site.
    it is very hard creating a perfect site that works on all browsers and different resolutions. The best option is trying to make it look good on the most common browsers that you are using.

    hoda nofal romano

  8. #7
    Junior Member
    Join Date
    Dec 2004
    Posts
    1
    Member #
    8574
    [QUOTE=sparkyhughes]This code makes it work ....

    Sparky, you jes' saved my newbie, wannabe, wouldbe professional
    life. I've been struggling for MONTHS (on and off) to finish my very
    first web site for a client, and the d*** thing wouldn't center but instead
    clustered up and left, and looked awful,

    AND I tried the regressive pre-CSS all-back-into-tables thing, with
    the generous help of a lovely person, and it didn't translate to other
    pages,

    AND I tried the negative margin thing and it screwed everything up

    AND I tried the making the body tag do it or making it a div class
    and making that do it all or making it a span class and having that
    do it and NOTHING. Nada. Zilch.

    And then came YOUR code above. Result: YEEHA!!!!!!!!!!!!!!!!!!!!!!!!!!

    I owe ya. What, I dunno. But I do. THANK YOU!

    -PW-

  9. #8
    Member
    Join Date
    Mar 2004
    Posts
    40
    Member #
    5208
    no worries dude, glad I could be of help. I am now making a new site and would you believe I am struggling with the same problem again. I just found this old thread and I will use my own code again!!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:25 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com