Forums / Templates, Stylesheets, Page Layout / Newbie: How can I CENTER the Main Image on product description?

Newbie: How can I CENTER the Main Image on product description?

Locked

Views: 1,555

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
27 Apr 2009, 3:43 AM
#1
hugozc avatar

hugozc

New Zenner

Join Date:
Apr 2009
Posts:
41
Plugin Contributions:
0

Newbie: How can I CENTER the Main Image on product description?

ZC: 1.3.8a

Please refer to my website: http://hugocruzgallery.com/shop/index.php?main_page=product_info&cPath=1_2&products_id=1

I hope this is an easy answer for someone whom is more experienced. But I have searched high and low and added lines on the CSS but nothing seems to do what I am looking for. I am simply trying to center the MAIN IMAGE (like I centered the 'h1' Title).

I have Firefox and Firebug and tried every CSS possibility (that I could come up with). I would really appreciate it if someone could tell me exactly what CSS line/command I need to enter and where (line number) it should be entered to do this?

Thank you in advance.

27 Apr 2009, 5:01 AM
#2
hugozc avatar

hugozc

New Zenner

Join Date:
Apr 2009
Posts:
41
Plugin Contributions:
0

Re: Newbie: How can I CENTER the Main Image on product description?

Furthermore ...

I am guessing it will be around line 856 in my stylesheet.css under #productMainImage img. If my assumption is correct then GREAT! However, I have no idea what CSS line/code would work to CENTER the main image. I have tried:

vertical-align: center; (no change)
text-aligh: center; (no change)

Please let me know where I went wrong. Thank you.

27 Apr 2009, 5:13 AM
#3
hugozc avatar

hugozc

New Zenner

Join Date:
Apr 2009
Posts:
41
Plugin Contributions:
0

Re: Newbie: How can I CENTER the Main Image on product description?

Well, it looks like I answered my own question. Amazing what a little Googling can get you :-). It seems as though the correct CSS commands are:

display: block;
margin-left: auto;
margin-right: auto }

and I (or you) can add this to your main image heading (read my previous comment). Seems to work perfectly on my site.

Yet, if any one with CSS experience sees a problem with what i did then please throw in your two cents. I will gladly accept any advice that comes my way.

27 Apr 2009, 5:21 AM
#4
hugozc avatar

hugozc

New Zenner

Join Date:
Apr 2009
Posts:
41
Plugin Contributions:
0

Re: Newbie: How can I CENTER the Main Image on product description?

EDIT UPDATE: I just noticed my image is NOT perfectly centered (perhaps about 25px too far to the RIGHT). AAAaaarrrgh!!! Anyone have any ideas or advice on how to CENTER this perfectly?

Also, the CSS centering works on IE but Firefox still has the image LEFT aligned ... ????

-- Thank you.

Refer to: http://hugocruzgallery.com/shop/index.php?main_page=product_info&cPath=3_7_8&products_id=4

27 Apr 2009, 2:54 PM
#5
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Newbie: How can I CENTER the Main Image on product description?

You will need to edit your template file;

\includes\templates\custom\templates\tpl_modules_main_product_image.php

change the line;

<div id="productMainImage" class="centeredContent back">

to;

<div id="productMainImage" class="centeredContent">

removing the class "back" will stop the image being floated to the left.

Steve

27 Apr 2009, 2:56 PM
#6
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Newbie: How can I CENTER the Main Image on product description?

Get yourself Firebug - an extension for Firefox... A great tool for troubleshooting CSS and Template issues.

Steve

27 Apr 2009, 6:19 PM
#7
hugozc avatar

hugozc

New Zenner

Join Date:
Apr 2009
Posts:
41
Plugin Contributions:
0

Re: Newbie: How can I CENTER the Main Image on product description?

s_t_e_v_e,

THANK YOU! THANK YOU! THANK YOU!!!! You are the best! I cannot believe it was such a small edit (omitting the word "back"). Wow, the image is centered just the way I want it to be. I would have never come up with this solution on my own.

I already had Firebug and web Developer for Firefox ... Yes, you are completely correct. They are great add-ons/tools for tinkering newbies, like me, to expert programmers.

Thanks again!