View Full Version : Change alignment in module position?
jplamp
03-26-2010, 09:10 AM
Can anyone tell me where in the CSS to change it so that the contents of the module are aligned center? I have one module in the Right position that is showing up as left-aligned, and I want it to be centered in the module. I asked at the forum where the module came from, and they said it was a CSS issue with my template. I am using Relax1.
Thank you!
Hello jplamp,
The text alignment of the right modules is set to "right" by default as you can see from the following lines in the template.css file:
#rightcolumn div.module_menu div div div, #rightcolumn div.module div div div{
margin: 0;
background: url(../images/menu_top_out.png) top right no-repeat;
text-align: center;
padding: 0 0 10px 0;
When you create your module using the Module Manager, you should make sure that the text in question is placed within a div tag and NOT in a paragraph one, which is the default value.
jplamp
04-05-2010, 09:49 AM
Thanks for the reply, and for showing me that location in the template.css file. I played around with it and it did help me to change the alignment of the list items in other modules in the Right position (which I actually like better), but unfortunately it did not change the alignment of this one particular module. I'm afraid this is an unsolvable problem. I tested it out with one of the default Joomla templates, and it works just fine (module is centered as it should be), so obviously the trouble is with the template somewhere. I just can't figure it out. There is no place in the module parameters to change the alignment, and a look at Firebug indicates that it is in a div inside the right column div. So I just don't know. I think I will just have to live with this unsightly problem, since I really love this template and it is perfect for my needs. You can see the site at www.fdlgardenclub.org .
In case anyone wants to know or is searching for an answer to the same problem, the module is the Random Image module that goes with Phoca Gallery. The creator of Phoca Gallery has tried to be helpful, but his best answer is to use another template, which I don't want to do.
Hello jplamp,
The module in question has its own CSS file residing at:
<your_Joomla_installation>/modules/mod_phocagallery_image/assets/phocagallery_module_image.css
This is why you have not managed to adjust the alignment of that module by altering the template.css file. I managed to adjust the style attributes of the phocagallery-module-ri class in the above mentioned file (lines 9 - 11) and now the module seems to be centered properly.
jplamp
04-06-2010, 11:11 AM
Yay, that did it! Thank you SO MUCH! I see now that line 11 had "padding-right:100px;" and that was the trouble. I had tried to edit this file before, but didn't really know what I was doing, and you showed me the way. Thanks again!
Hello jplamp,
You are most welcome :) I am glad that I managed to assist.