Vetical and Horizontally Align an image in a box
- by Rhyso
The problem:
I have a set width and height image Lets say height:160px; width:200px; with an image in each box.
The image can vary in size but I need a solution that will always center the image vertically and horizontally within the box no matter what it's size.
Horizontal doesn't seem to be a problem by using margin: 0 auto but vertical is proving difficult. I have tried vertical align: center but this doesnt appear to work either
Any help is appriciated
Thanks