0

http://jsfiddle.net/9ctTD/18/

I have some labels which may or may not wordwrap. When the label wordwraps, my input element vertically aligns to the bottom of the containing div. I would like my input element to align with the center of the word-wrapped element.

I was able to achieve this through use of vertical-align: 50%, but this had the negative side-effect of breaking alignment for non-wordwrapped label/input pairs.

I had a look at this StackOverflow post regarding alignment, but it appears to solve a different issue than the one I am experiencing.

Anyone know how to achieve this?

Community
  • 1
  • 1
Sean Anderson
  • 27,963
  • 30
  • 126
  • 237

1 Answers1

1
label {
  max-width: 80px;
  vertical-align:middle;
}

Rick Calder
  • 18,310
  • 3
  • 24
  • 41
  • Huh. Css is an odd beast even after years of practice. Could've sworn I had tried that, but apparently I had not! Thank you! – Sean Anderson Nov 15 '12 at 00:06