开发者

How to vertically center inline elements in CSS

This may seem like a silly question, but I am not getting the expected results from vertical-align. So…

  1. Does vertical-align:center center the child items of the item that has this property, or does it center the item itself that has this property, within its parent?

  2. To me, “开发者_高级运维center” means the distances between the item’s top margin and the container’s top padding, and the item’s bottom margin and the container’s bottom padding are the same. This doesn’t seem to always be the case. Is the “bottom” of an inline element the baseline of the text?

Thanks!


Please take a look here: http://www.w3schools.com/css/pr_pos_vertical-align.asp

According to that, vertical-align:middle make the item itself in middle according to the parent.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜