Solved

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

Posted on 2009-05-12
3
815 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Are these icons a web font? 3 29
Why "Mobile First"? 5 63
HTML CSS and  Table design 4 70
Some inputfields not clickable on iPad Safari, Ok in other browsers 3 48
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

710 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