views:

255

answers:

3

is it possible to vertically align an image coming inside an anchor tag ?

I am using two anchor tags inside a DIV.. each one should vertically align to center. in one I am using an image in another one text ?

PS: without line-height

+1  A: 

You can't vertical align inside a div tag but you can with a table cell. You could work around it if you can fix the height of your image and its container.

Rimian
+3  A: 

Vertical align does not behave as you'd think in divs since it works only for table cells.

There are numbers of CSS "hacks" to get that to work such as this one or this one

marcgg
+1 nice reference.
Saar
A: 

Consult the following url, it may hold the answers you need as well as give you a comprehensive understanding of the vertical align property.

http://css-tricks.com/what-is-vertical-align/

Adam C