Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

vertical-align

The vertical-align property sets the vertical alignment for the tag. The default is baseline. You’ll probably find that this property doesn’t work very well, if at all.

The value may be a percentage relative to the tag's line-height property that would raise the tag's baseline the specified amount above the parent's baseline. 100% equals the text's line height. So 50% moves the tag up half a line. You can have negative values, for example, -100% moves the element down one full line.

The value may also be a keyword:

  • Baseline. Aligns baselines of tag and its parent
  • Middle. Aligns the middle of the tag with baseline plus half the x-height (the height of the letter "x") of the parent
  • Sub (subscript)
  • Super (superscript)
  • Text-top. Align tops of tag and parent's font
  • Text-bottom. Aligns bottoms of tag and parent's font
  • Top. Aligns top of tag with tallest tag on the line
  • Bottom. Aligns bottom of tag with lowest tag on the line