Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Help centering main product image!!

Help centering main product image!!

Views: 959

Results 1 to 7 of 7
7 Aug 2012, 6:47 PM
#1
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Help centering main product image!!

Hello Everyone,

I'm trying to center my main product images using #productMainImage in the main stylesheet.

An example can be found here:
http://www.kcbgraphics.com/index.php?main_page=product_info&cPath=11_315&products_id=1769

I've tried using:
#productMainImage
display: block;
margin-left: auto;
margin-right: auto;

and a couple of other methods I've read about but nothing seems to work.

I'm using Zen 1.3.9h, PHP Version: 5.3.10 & MySQL 5.0.95. If there's a Zen Cart CSS guru out there who can point me in the correct direction I would really appreciate it.

Thank you!!

7 Aug 2012, 7:30 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help centering main product image!!

You could move it over with specific margin:

#productMainImage {margin: 0 0 0 5em;}

7 Aug 2012, 7:33 PM
#3
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Help centering main product image!!

You could try:

#productMainImage {
   margin-left: auto;
   margin-right: auto;
   width: 100%;
}

The width gives your image room to move.

Hope this helps.

7 Aug 2012, 7:35 PM
#4
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Help centering main product image!!

stevesh:

You could move it over with specific margin:

#productMainImage {margin: 0 0 0 5em;}

Thanks for the reply Stevesh.

That will work but my image widths vary quite a bit and a margin setting that works for that image is still off center for other images. Is there no way to force the images to center in that column?

7 Aug 2012, 7:41 PM
#5
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: Help centering main product image!!

Get Em Fast:

You could try:

#productMainImage {
margin-left: auto;
margin-right: auto;
width: 100%;
}

> 
> The width gives your image room to move.
> 
> Hope this helps.

Thanks Get Em Fast,

That worked perfectly!
7 Aug 2012, 8:01 PM
#6
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Help centering main product image!!

kcb410:

Thanks Get Em Fast,

That worked perfectly!

Not a problem. Glad to help.

8 Sep 2012, 10:09 PM
#7
ljdream00 avatar

ljdream00

Zen Follower

Join Date:
Jun 2007
Location:
Michigan
Posts:
168
Plugin Contributions:
0

Re: Help centering main product image!!

This worked PERFECTLY, THANKS:D
I'm not new to Zencart and this worked my nerve because I could NOT figure out how do to this.

Get Em Fast:

You could try:

#productMainImage {
margin-left: auto;
margin-right: auto;
width: 100%;
}

> 
> The width gives your image room to move.
> 
> Hope this helps.