Solved

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

Posted on 2009-05-12
3
816 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
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.
Suggested Courses

615 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