css - 行内 block 元素之间的边距

标签 css

我有两个内联 block 元素,它们之间有一个我似乎无法控制的边距。

如何让浅蓝色元素接触以下 JSFiddle 中的绿色元素?

http://jsfiddle.net/oregontrail/XvBa7/1/

.indicator {
    display:inline-block;
    width:100px;
    height:50px;
    text-align: center;
    background: PaleTurquoise;
    vertical-align: top;
}

.handle {
    display:inline-block;
    width: 50px;
    height: 50px;
    text-align: center;
    background: limegreen;
}

最佳答案

.indicator.handle 中的 display:inline-block 替换为 float:left

关于css - 行内 block 元素之间的边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17731776/

相关文章:

javascript - 在输入文本表单旁边添加标签

html - 伪元素在 Internet Explorer 上的 hr 标记中无法正常工作之后

html - 使用选择启用和禁用输入字段

css - 如何在 Bootstrap 中将文本和链接放在图像之上?

html - 使用固定背景附件和旋转容器重复背景?

html - 为什么 <div> 内的 <div> 不会注意到外部 <div> 边距?

c# - mvc 模板中定义的导航栏在哪里?

html - Formspree 表单不适用于定制设计的联系表单

IE 中的 CSS 菜单问题

html - Angular 2 : Having a fixed element positioned by relation to its parent