问题描述
这是我的960网格系统案例:
This is my 960 grid system case:
<div class="kundregister_grid_full">
<div class="kundregister_grid_1">ID</div>
<div class="kundregister_grid_1">Namn</div>
<div class="kundregister_grid_1">Anv.Namn</div>
<div class="kundregister_grid_1">Email</div>
<div class="kundregister_grid_1">Roll</div>
<div class="kundregister_grid_1">Aktiv</div>
</div>
这是我的div集合,用作表结构。
This is my set of divs, used as a table structure.
CSS如下:
.kundregister_grid_1 {
display: inline-block;
float: left;
margin: 0;
text-align: center;
}
.kundregister_grid_1 {
width: 140px;
}
不介意瑞典命名。我想要div显示,即使他们没有值。
Don't mind the Swedish naming. I want the divs to show even though they have no values.
<div class="kundregister_grid_full">
<div class="kundregister_grid_1">ID</div>
<div class="kundregister_grid_1"></div>
<div class="kundregister_grid_1"></div>
<div class="kundregister_grid_1">Email</div>
<div class="kundregister_grid_1">Roll</div>
<div class="kundregister_grid_1">Aktiv</div>
</div>
像这样,在这种情况下,两列中没有Namn和Avn.Namn 。但是,当在chrome中运行它们时,它们被删除,不再以 float:left
的顺序推动其他div。因此,如果我在上面的相同div中有类别,那么值将被置于错误的类别。
Like so, in this case there's no 'Namn' and 'Avn.Namn' in the two columns. However when running this in chrome, they are removed, and do no longer push the other divs in the order float:left
. So if I have categories in same divs above, then the values would be placed under wrong category.
推荐答案
浮动。
与浮动它只有工作,如果有一些内容例如& nbsp;
with floats it only works if theres some content e.g.
这篇关于如何使一个空的div占用空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!