PDA

View Full Version : Centering



me4u2nv
03-10-2009, 04:27 PM
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

Excavator
03-10-2009, 05:28 PM
Hello me4u2nv,
That site looks pretty centered... maybe it would help if you were more specific with what your trying to change.

me4u2nv
03-10-2009, 07:00 PM
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?option=com_content&view=article&id=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;
}

Excavator
03-10-2009, 07:18 PM
This should center #main-content -
#main-content {
background: #fff;
color: #333;
width: 800px;
margin: 0 auto;
}


To center an element you need:

DocType
Width
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.



...

me4u2nv
03-10-2009, 08:06 PM
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!