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 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    84
    Thanks
    47
    Thanked 0 Times in 0 Posts

    Can't Center...please help!

    I've been going crazy over this for an hour. Hopefully someone can help. It's a small .css

    I have one div that is 100% and text align center (.wraper). I then want another div to contain the main content (.container) and have it a static width of 800px. No matter what I do, the container is always all the way to the left. How do I get the container to be centered on the page. I don't want to use margins because I want it to be centered no matter what the resolution or screen size. Thanks for any input

    The site is www.tanseekers.com and .css is www.tanseekers.com/style.css

  • #2
    New Coder
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    0
    Thanked 4 Times in 4 Posts
    all you have to do is add a margin of auto and it will center no matter what the screen size is.

    Code:
    .container {width:800px; margin:auto }

  • Users who have thanked tjoyce0909 for this post:

    jdblewitt (08-03-2010)

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    84
    Thanks
    47
    Thanked 0 Times in 0 Posts
    Thank you sooooo much! I though I had already tried that but maybe I had it in the wrong div. Works great now!

  • #4
    New Coder
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    0
    Thanked 4 Times in 4 Posts
    no problem, love the background btw.


  •  

    Posting Permissions

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