gpt4 book ai didi

html - CSS HTML : stumped on how to center this piece of text

转载 作者:太空宇宙 更新时间:2023-11-04 00:23:02 25 4
gpt4 key购买 nike

如何让这个下拉菜单的名称“Tony Robbins”垂直居中?我尝试将 vertical-align:middle 添加到包含文本的 span 和包含文本的 li#drop-avatar 中。有人可以让我知道我做错了什么吗?

附言还有一种方法可以使文本对齐:居中也可以使“托尼·罗宾斯”也水平居中吗?

http://jsfiddle.net/vJaaR/

最佳答案

添加:

img
{
vertical-align: middle;
}

因为您的文字与图片是内嵌的,所以您需要告诉图片如何与文字对齐。

关于html - CSS HTML : stumped on how to center this piece of text,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8159221/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com