Html <;上的未知附加空间;部门>;顶部

Html <;上的未知附加空间;部门>;顶部,html,css,Html,Css,我正在创建一个包含多个div的表madde,在第一行(样式为head)和其余行之间有一个额外的空间,只有前两列(div)。在这里你可以清楚地看到: 没有一种风格的安替比妥造成了这个空间,至少我找不到它的原因 我在JSFIDLE上复制了它,您可以看到它还设置了额外的空间: 这里我带来了与HTML和Syle相关的代码: HTML: 由于元素是内联块,因此可以使用垂直对齐:顶部根据需要对齐它们。值得注意的是,默认属性值是baseline;这就解释了为什么他们会这样做 使用溢出:隐藏对于内容列60,2

我正在创建一个包含多个div的表madde,在第一行(样式为head)和其余行之间有一个额外的空间,只有前两列(div)。在这里你可以清楚地看到:

没有一种风格的安替比妥造成了这个空间,至少我找不到它的原因

我在JSFIDLE上复制了它,您可以看到它还设置了额外的空间:

这里我带来了与HTML和Syle相关的代码:

HTML:


由于元素是
内联块
,因此可以使用
垂直对齐:顶部
根据需要对齐它们。值得注意的是,默认属性值是
baseline
;这就解释了为什么他们会这样做


使用
溢出:隐藏对于内容列60,20,10,它工作得非常完美

添加一个clearfix或使用垂直对齐:顶部和溢出:隐藏

.contentColumn60:after {
  content: "";
  display: table;
  clear: both;
}

这解决了我的问题,谢谢。我不知道这片土地。我会在8分钟内给你的答案打勾。你知道我为什么会有这个问题吗?从理论上讲,似乎并没有理由增加这个额外的空间…我尝试了这个,但它只是隐藏了溢出的内容,这意味着行的一半。垂直对齐:顶部适合我。谢谢,谢谢你的关注。这件衣服对我来说也很合适。
.tableWrap{
    width: 100%;
    height:380px;
    border:#ccc 1px solid;
    border-radius:3px;
    box-shadow: 0 1px 2px #d1d1d1;
    margin: 10px;
    background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
    background: -moz-linear-gradient(top,  #fbfbfb,  #fafafa);
    font-size:12px;
    color:#666;}

.tableHeader{
    height: 40px;
    width: 100%;
    background: -moz-linear-gradient(center top , #EDEDED, #EBEBEB) repeat scroll 0 0 rgba(0, 0, 0, 0);
    border-bottom: 1px solid #E0E0E0;
    border-left: 1px solid #E0E0E0;
    border-top: 1px solid #FAFAFA;
    display: inline-block;
    font-weight: 600;
}

.tableHeaderText{
     line-height: 40px;
     padding: 0 10px;
}

.tableContent{
    height: 40px;
    width: 100%;
}

.tableContentText{
    line-height: 40px;
    padding: 0 0 0 20px;
}

.contentColumn60{
    height: 40px;
    width: 58%;
    border-top:1px solid #fafafa;
    border-bottom:1px solid #e0e0e0;
    border-left:1px solid #e0e0e0;
    display: inline-block;
}

.contentColumn20{
    height: 40px;
    width: 20%;
    border-top:1px solid #fafafa;
    border-bottom:1px solid #e0e0e0;
    border-left:1px solid #e0e0e0;
    display: inline-block;

}

.contentColumn10{
    height: 40px;
    width: 10%;
    border-top:1px solid #fafafa;
    border-bottom:1px solid #e0e0e0;
    border-left:1px solid #e0e0e0;
    display: inline-block;
}

.discontinueIcon{
    width: 23px;
    height: 23px;
    background-size: 98%;
    background-image: url(images/error.png);
    background-repeat:no-repeat;
    margin: 0 auto;
}

.editIcon{
    width: 23px;
    height: 23px;
    background-size: 98%;
    background-image: url(images/edit.png);
    background-repeat:no-repeat;
    margin: 0 auto;
}
.contentColumn60 {
    height: 40px;
    width: 58%;
    border-top: 1px solid #fafafa;
    border-bottom: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    display: inline-block;
    vertical-align: top;
}

.contentColumn20 {
    height: 40px;
    width: 20%;
    border-top: 1px solid #fafafa;
    border-bottom: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    display: inline-block;
    vertical-align: top;
}
.contentColumn60:after {
  content: "";
  display: table;
  clear: both;
}