开发者

CSS - vertically centering inside BUTTON element

开发者 https://www.devze.com 2023-02-20 06:15 出处:网络
i\'m trying to create a row 开发者_开发问答with buttons, where the content inside the button is vertically aligned to the middle of the button. All buttons should should be the same height.

i'm trying to create a row 开发者_开发问答with buttons, where the content inside the button is vertically aligned to the middle of the button. All buttons should should be the same height.

problem is when an image is used inside a button.

i made a small example: http://jsfiddle.net/L2L2G/

why is the the third button not aligned with the other 2 ? I think that the buttonheight should be enough for the small content?


If I use vertical-align:middle; instead of absmiddle, it works fine in Chrome.

AFAIK the latter is not a valid value for vertical-align.

Demo

0

精彩评论

暂无评论...
验证码 换一张
取 消