【问题标题】:How can I remove the white margin between the div's如何删除div之间的白边
【发布时间】:2013-11-09 21:52:41
【问题描述】:

div 之间有空白边距,我想将其删除,所以根本没有边距

这里是小提琴链接:http://jsfiddle.net/sz3MD/5/

body  {
       margin: 0;
       padding: 0;
       background: orange;
       font: 10px/13px 'Lucida Sans',sans-serif;
    }

    .wrap {
       overflow: hidden;
       margin: 10px;
       background-color: #fff;
    }

    .box {
       float: left;
       position: relative;
       width: 14%;


    }

    .boxInner img {
       width: 100%;
    background-color: blue;

    }

【问题讨论】:

  • 我在您的代码中没有看到任何白边。
  • 尝试设置 display: block to your images
  • @ManoloSalsas 在蓝色方块的右边大约 1 px,在底部大约 2-3px
  • @katranci 非常感谢这就是我所需要的

标签: html css dom margin


【解决方案1】:

给你。

WORKING DEMO

代码更改:

.boxInner img {
    background-color: #0000FF;
    border-collapse: inherit;
    display:block;
    padding: 0;
    width: 100%;
}

希望这是您正在寻找的。​​p>

【讨论】: