问题描述
在我的html中,我有一个生成的 ul
元素,它包含 li
>
我得到一个奇怪的 3px
(大约)我的 li
除了css定义的边距之外还有一个非常大的余量。
这是一个Chrome调试控制台快照。过度的区域用红色标出:
ul
s风格如下: li
的风格是:
为什么在那里?我如何摆脱它?
解决了。这就是浏览器如何呈现li之间的换行符。不得不强制HTML生成器渲染所有li在一行中删除之间的空间。
In my html, I have a generated ul
element that hold li
's with img
's in them.
I get a strange 3px
(approx) excesive margin between my li
's in addition to css defined margin.
Here is a Chrome debug console snapshot. A excessive area is outlined with red:
A ul
s style is the following:
li
's style is:
Exactly the same excessive margin appears in Firefox.
Why is it there? How do I get rid of it?
Solved. It's how browsers render line breaks between li's. Had to force the html generator render all li's in one line to remove the space between.
这篇关于Chrome和Firefox中过度的UL保证金的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!