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 7 of 7
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    92
    Thanks
    2
    Thanked 0 Times in 0 Posts

    How to center...?

    Can anyone explain how to center this page:

    http://ucmsigeps.com/index.php

    I have set the body to having text-align: center and that still didn't do it.

    THANKS!

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    #wrap {
    margin:0px auto;
    }

  • #3
    New Coder
    Join Date
    May 2009
    Posts
    92
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thanks seco, but the problem is still here. I want the whole page centered but still have the text aligned to left.

    Trying the code above:

    http://ucmsigeps.com/index.php

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello bfinke,
    To center something it has to have a width. Then margin: auto; has something to work with.
    Give #wrap a width of 1000px and your margin:0 auto; will center it (you style #wrap twice and the other one has margin: 0; so you will need to delete that)
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    New Coder
    Join Date
    May 2009
    Posts
    92
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Awesome, thank you.

  • #6
    Regular Coder
    Join Date
    Dec 2007
    Posts
    107
    Thanks
    0
    Thanked 3 Times in 3 Posts
    You can also try using <center></center> tags.

    The <center> tag should be just after the <body> tag & </center> should be just before </body> tag.

    That makes whole page to be aligned centered.
    Programming & Webmaster Forum - AdSense Revenue Sharing forum

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    The center tag has been depricated.
    http://www.w3schools.com/tags/tag_center.asp
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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