Firefox 3通过display:inline-block为span添加间距 [英] Firefox 3 adds spacing to spans with display:inline-block

查看:132
本文介绍了Firefox 3通过display:inline-block为span添加间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的测试中,我有两个跨度都设置显示:inline-block带有边框的可见性。 Firefox在每个span之间渲染空间。偶数设置边距:0; padding:0;不做任何事情来解决这个问题。我设置要显示的内联跨元素时,我的期望:inline-block是两个跨度渲染互相冲洗,就像你向左或向右浮动2个div一样。我发现的唯一的修复是添加float:左或右到跨度,但是打败了我试图不使用浮动的原始目的。任何想法?

In my test, I have 2 spans both set to display:inline-block with a border for visibility. Firefox renders space between each span. Even setting margin:0;padding:0; doesn't do anything to fix this. My expectation when setting the inline span element to display:inline-block is that the 2 spans render flush against each other, as if you floated 2 divs left or right. The only "fix" I have found is to add float:left or right to the spans, but that defeats my original purpose of trying not to use floats at all. Any ideas?

<style>
    span{
        border:2px solid #000;

        display:inline-block;

        padding:0;
        margin:0;
    }
</style>
<span>Test</span>
<span>Test2</span>


推荐答案

换行符。

这篇关于Firefox 3通过display:inline-block为span添加间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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