css - 内联样式元素跨浏览器具有不同的水平间距

标签 css cross-browser

我有内联显示的元素,它们之间有一些水平间距。这很好,但我需要间距的数量与目前不是的交叉凉亭相同。我可以在不使用花车的情况下实现这一目标吗?

我需要支持 IE7,所以我不能使用内联 block ,但如果绝对必要,我可以使用 IE7 样式表。

http://jsfiddle.net/2uBuu/3/

<div>
    <label>label</label> 
    <select>
        <option>1</option>
        <option>2</option>
        <option>3</option>
    </select>
</div>
<div>
    <label>label</label>  
    <select>
        <option>1</option>
        <option>2</option>
        <option>3</option>
    </select>
</div>



<div>
    <label>label</label>
    <select>
        <option>1</option>
        <option>2</option>
        <option>3</option>
     <select>
 </div>
 <div>
    <label>label</label>
    <select>
       <option>1</option>
       <option>2</option>
       <option>3</option>
     <select>
  </div>

div {
    background-color: blue;
    display: inline;
}
label {
    display: none;
}    
​
​

最佳答案

您仍然没有关闭 SELECT(现在是第二部分)...

只需添加

select{
    padding: 0px;
    margin: 0px;
}

覆盖与 SELECT 框相关的浏览器特定行为...例如,如果未指定,chrome 会为其添加填充和边距。

这是一个关闭了所有 SELECts 并指定了填充和边距的 fiddle ,它对我有用:http://jsfiddle.net/2uBuu/6/

关于css - 内联样式元素跨浏览器具有不同的水平间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14138596/

相关文章:

html - 跨浏览器 SVG preserveAspectRatio

javascript - .find ("tagname") 空结果(偶尔适用于 Chrome)

html - 将 cute-slider 与 HTML5 样板集成

javascript - 移动Web开发如何有效利用资源?

html - 垂直居中在 Mozilla 下不起作用

javascript - 使用 JS 将 REST 数据附加到矩阵网格

Javascript 对于 DOM 操作来说太快了?

html - 图标链接在手机上无法点击

html - 过渡到全窗口(不是屏幕)

html - 媒体查询不起作用,可能存在语法问题