tags:

views:

765

answers:

3

I'm coding it

<div>
 <a href="http://example1.com"&gt;
   <img src="example1.gif" />
 </a>
</div>
<div>
 <a href="http://example2.com"&gt;
   <img src="example2.gif" />
 </a>
</div>

a {
  text-align:center;
  height :80px;
  display:block;
}

The centering of the horizontal direction do well. but vertical is not. How to do it? By the way, the height of example2.gif is different from example1.gif

A: 

You will want to set vertical-align: middle; on your img elements.

Cide
+3  A: 

This article may help -- http://www.brunildo.org/test/img_center.html Of necessity, it involves a bit of a hack for down-version IE.

Steve Gilham
A: 

thanks for sharing, i try for my css but not success. pls help me this site