views:

15

answers:

1

I have an image next to an input, and I was wondering how I centered both with one another. I need the center of the image to be vertically aligned with the center of the input. How do I make this happen?

Markup:

<span class="my-span">
  <input type="text" .../><a href="..."><img .../></a>
</span>
+1  A: 

Setting the vertical-align to middle on the <img> should put you in business:

<span class="my-span">
    <input type="text" .../><a href="..."><img ... style="vertical-align: middle"/></a>
</span>

You can see it in action here.

Pat
This doesn't work for me. Something must be styling the <input> to cause it to be offset somehow.
Stefan Kendall
If you can post any related CSS I don't mind taking a look.
Pat