Forum Moderators: not2easy

Message Too Old, No Replies

Button text vertical alignment

         

Tonearm

9:53 pm on May 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does anyone know which CSS property controls the vertical alignment of the text inside a button? My button's text is aligned too high in IE.

- Grant

createErrorMsg

10:55 am on May 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are we talking a list-based menu, or a table?

If list-based: the vertical-align property, as I'm sure you know, doesn't work with list items. This is because vertical-align works only to center the contents of a table cell or an inline box. If you've used the height property to set the button height, this acts upon the block level anchor, not the inline text box the anchor contains.

Instead of height, try line-height. This sets the height of the inline text box the anchor contains to match the button image height. Vertical-align should then center to the middle of that (and it should do it by default, since middle is vertical-aligns default setting).

cEM

Tonearm

1:42 am on May 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks a lot for your response. The button text turned out to be messed up because of a style I shouldn't have applied to it.

- Grant