Vertically centre img next to other img

I’m sute this is really easy but it’s doing my head in!!

I have one image which is 20px high and one which is 50px high. I want then side by side with the smaller one vertically centered to the larger one.

cheers :slight_smile:

assuming they are in the same container img{vertical-align:middle;} should do the trick.

hope that helps!


<div>
  <span style="vertical-align:middle"><img src="/images/pwl_title.gif" width="443" height="25" /></span>
  <img src="/images/pwl_logo.gif" width="522" height="115" />
 </div>

does nothing! This is what i thought should work!

You gave the SPAN the vertical align , not the IMG.

Alternatively, if you know the heights of the two images, use position:relative; to move one of them by half-the-difference.

It’s late, i’m tired and I’ve been doing this all day!! I knew i was doing something really supid!! :blush:

Cheers for your help buddy!