Solved

CSS question

Posted on 2011-03-01
4
858 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now