PDA

View Full Version : Centering Images


Hub-Site
08-23-2008, 10:04 AM
Hi there,

I'm trying to add a row of images above the menu bar in the liveDIR template. I can get the images to show, but they're not centered. I have a center tag in there and it helped in that they're not all the way to the left any more, but they're not centered on the page. Any suggestions?

Additionally, eventually I'd like to get it set up so that the pics alternate when the page is reloaded. Does anyone know some easy code to do that? I know it's not that hard and I used to have some HTML code that handled it but I can't find it and everything I've found online confuses me since I'm not really a coder.

Thanks for your help!

LINK: http://www.must-do-that.com (keep in mind it's still under development ;))

bruleo
08-23-2008, 11:14 AM
When centering a div, that's all it does...center the div, and not's it's content. Try setting the width of the div that contains the images to the width of the template and then set 'text-align:center' and adjust any margins or padding you may have. Without looking at your css, I can't really say exactly.

Rotaing content is really easy with smarty... Look here: http://www.phplinkdirectory.com/forum/showthread.php?t=21644

.... and use a template for each group of images you want to rotate, then instead of calling the image like you have now, call each template.

Bruce.

Hub-Site
08-23-2008, 04:42 PM
Thanks so much for the response! That link is exactly what I'm looking for and then centering worked perfectly. I just added a css category.

I'll probably be back on that other thread with follow-up questions.

thanks again!