Solved

CSS question

Posted on 2011-03-01
4
905 Views
Last Modified: 2012-08-14
I have this page:
http://tinyurl.com/4e99682

There are three thumbnails under the main image. I am trying to center those thumbnails.

When I remove this code from the css:
div.category_view_product a img.product_image{
  float: left;
  margin-right: 6px;
  }


and replace it with margin:0 auto; the images do not center.

I don't want to manually pad the images because sometimes there will be more then three images. Any idea how to fix this?
0
Comment
Question by:lvollmer
  • 2
4 Comments
 
LVL 13

Assisted Solution

by:darren-w-
darren-w- earned 200 total points
ID: 35012861
Can't see the source on page, but what I would normally do is th wrap the items in a new div and float it using your code
<div id='cen'>{image code here}
</div>

CSS:
#cen{margin:0 auto;}

Open in new window

0
 

Author Comment

by:lvollmer
ID: 35013310
that didn't seem to work. Here is what I did:

  .wpcart_gallery {
margin: 0 auto;  }

div.wpcart_gallery img{
      
      margin-top:3px;
      margin-left:3px;
      margin-right:3px;
      margin-bottom:3px;
      border:1px solid #9A9CCD;
}
 




<div style="background-color:#EEE8E0; border:1px solid #D5D3D0; padding:5px;">
		<div class='wpcart_gallery'><a href='http://s111576.gridserver.com/wp-content/uploads/wpsc/product_images/01.Tank.Front.Nude.0009.jpg' rel='enlargeimage' rev='targetdiv:loadarea' rel="wp-prettyPhoto[g142]"><img src='index.php?image_id=152&amp;width=300&amp;height=300' alt='' title='' width='69' height='69' /></a><a href='http://s111576.gridserver.com/wp-content/uploads/wpsc/product_images/02.Tank.Back.Nude.0052.jpg' rel='enlargeimage' rev='targetdiv:loadarea' rel="wp-prettyPhoto[g142]"><img src='index.php?image_id=153&amp;width=300&amp;height=300' alt='' title='' width='69' height='69' /></a><a href='http://s111576.gridserver.com/wp-content/uploads/wpsc/product_images/03.Tank.Side.Nude.0018.jpg' rel='enlargeimage' rev='targetdiv:loadarea' rel="wp-prettyPhoto[g142]"><img src='index.php?image_id=154&amp;width=300&amp;height=300' alt='' title='' width='69' height='69' /></a></div>		</div>

Open in new window

0
 
LVL 16

Accepted Solution

by:
SSupreme earned 300 total points
ID: 35013708
.wpcart_gallery {
margin: 0 auto;  
width:175px;}
0
 

Author Closing Comment

by:lvollmer
ID: 35013732
thanks to both
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Google Analytics - viewing a page 10 46
alert on input text 2 23
Regular Expression needed 4 14
Increase image taller on inner pages 2 11
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question