字体大小为0(零)的div / child的奇怪行为 [英] Strange behavior on div/child with font-size 0 (zero)
本文介绍了字体大小为0(零)的div / child的奇怪行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
要
1 > - 页面顶部和容器之间有空白。
Here's a jsfiddle to illustrate how the container appears when font-size: 1em
is set. It's everything fine.
2 - 即使使用自己的字体大小,内部文本消失。
But check this other jsfiddle: when I set the container with font-size: 0em
I get 2 unwanted issues:
所以,我的问题是:为什么会发生,我该如何解决这个问题?
display:inline-block;
如果您将其更改如下:
vertical-align: middle;
display: inline-block;
It will solve your issue.
它可以解决您的问题。
DEMO
Font-display-issue
这篇关于字体大小为0(零)的div / child的奇怪行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文