If this is your first visit, check our documentation. To post, register or login.

Help centering main product image!!

Started by kcb410 on 7 Aug 2012, 6:47 PM · Views: 973

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

Post #1 by kcb410

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

Post #2 by stevesh

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

Post #3 by 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.

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

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

kcb410

Zen Follower

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

Post #4 by kcb410

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

Post #5 by kcb410

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

Post #6 by get_em_fast

kcb410:

Thanks Get Em Fast,

That worked perfectly!

Not a problem. Glad to help.

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

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

ljdream00

Zen Follower

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

Post #7 by ljdream00

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.

Zencart Websites I've Designed:
deejaycentipede(DOT)com
djellery216(DOT)com