html - 使用 em 调整字体大小 - 如果 base-size = 0 怎么办?

标签 html css font-size

<分区>

Possible Duplicate:
Unwanted margin in inline-block list items
A Space between Inline-Block List Items

为了避免 li 设置为 display: inline-block 之间的差距,我将 ul 的字体大小设置为0. 因此 em 大小的性质,0 现在作为所有 li 的基本字体大小传递,这实际上意味着人们看不到它们。

有没有办法在不为列表项设置font-size: 14px(例如)的情况下解决这个问题?

最佳答案

Just float them instead Maybe they don't need to be inline-block at all, maybe they can just be floated one way or another. That allows you to set their width and height and padding and stuff. You just can't center them like you can by text-align: center; the parent of inline-block elements.

看看这个来源:http://css-tricks.com/fighting-the-space-between-inline-block-elements/

它列出了您的问题的多种解决方案。 避免将字体大小设置为 0

关于html - 使用 em 调整字体大小 - 如果 base-size = 0 怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14569127/

相关文章:

css - 比较 Chrome 和 Firefox 的字体大小问题

python - 为每个用户创建唯一的个人资料页面 python

html - 看不到我的导航标签

html - float div 上的框阴影

html - 如何在不更改文本颜色的情况下更改光标颜色?

html - 是否有 CSS 属性和 HTML 属性之间的等效项列表?

list - 一个 CSS3 网格列表 2x6

html - flex 盒动画

python - 如何设置 Matplotlib 轴图例的字体大小?

java - Swing中设置JComboBox的文本大小