Solved

horizontal centering of image in <td> with css generated drop shadow

Posted on 2009-05-12
3
814 Views
Last Modified: 2012-08-13
looking to center an image that is using a css generated drop shadow with negative margins and float:left;

i'm using tables as opposed to pure css because of the cms we're plugging this into.

here's the link:

http://ctemps.cjehost.com/thumbs2_table.php

notice how the thumbnails are horizontally aligned to the left-i need them to horizontally align center.  i'm sure it's the float:left and negative margins that are throwing me for a loop here. but, short of rethinking my drop shadow styles can anyone think of a quick fix here??
/*GALLERY DROP SHADOW*/
.img-shadow {
float:left;
background: url(../images/drop_shadow.png) no-repeat bottom right !important;
background: url(../images/drop_shadow.png) no-repeat bottom right;
margin: 10px 0 0 10px !important;
margin: 10px 0 0 5px;
}
/*GALLERY IMAGE href*/
a.imgOver img:hover{
background-color: #b81652;
}
a.imgOver img{
display: block;
position: relative;
margin: -10px 1px 1px -10px;
padding: 4px;
}
 
html:
 
<td height="136" width="136" align="center">
						<div class="img-shadow"><a href="#" class="imgOver"><img src="images/fpo_thumb_num4.jpg" border="0" /></a></div></td>

Open in new window

0
Comment
Question by:phillystyle123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 24391254
You can make your div have margin:0 auto with a specific width if you know the image width.

You can use display:inline with bottom-padding on your div/a if your image is flexible. Then use text-align:center on your td.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

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