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 5 of 5

Thread: Centering

  1. #1
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Centering

    I am wanting to adjust the article width on my Joomla site, and I have figured out that I have to add some code to the template_css.css file, but it is not centered. What could I add to the code to get this centered? Thanks

    #main-content {
    color: 333333;
    width: 1000px;
    }

    http://xxpressionz.com

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello me4u2nv,
    That site looks pretty centered... maybe it would help if you were more specific with what your trying to change.
    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

  • #3
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Hello excavator, thanks for the reply. I am trying to center all the articles on my Joomla site....I've adjusted the width, but am confused on how to get them centered, the white text area. Below is a link to one of the articles:

    http://xxpressionz.com/index.php?opt...d=47&Itemid=53

    I've added code to my css file, but not sure what to add to center the area:

    #main-content {
    color: 333333;
    width: 800px;
    }

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    This should center #main-content -
    Code:
    #main-content {
    	background: #fff;
    	color: #333;
    width: 800px;
    margin: 0 auto;
    }

    To center an element you need:
    1. DocType
    2. Width
    3. left and right margins set to auto


    As long as whatever you have inside #main-content will fit. I don't know what your table is doing but if it's more than 800px it will cause problems. Have a look at the link about tables in my sig below.



    ...
    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
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    God, that worked perfectly! I will read your information that you have listed....thanks for all your help on this, it took me forever to try and figure this out!


  •  

    Posting Permissions

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