Chrome和Firefox中过度的UL保证金 [英] Excessive UL margin in Chrome and Firefox

查看:138
本文介绍了Chrome和Firefox中过度的UL保证金的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的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 uls 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保证金的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆