我有一些列有一些行。
代码:
<div class="col-fluid">
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
<div class="height1">1</div>
</div>
因此,我为每个margin-top
类分配了height1
:
.col-fluid > [class*="height"]:not(:first-child) {
margin-top: 0.699301%;
}
现在,margin-top
存在一个问题,在某些高度尺寸(我完全不知道它们)中似乎margin-top
不起作用。
请参阅此屏幕截图中的第一个左栏:
但另一种尺寸,它有效:
有什么问题?我的margin-top
尺寸有问题吗?
答案 0 :(得分:0)
我认为,最好这样做:
<div class="col-fluid">
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
<div class="container"><div class="height1">1</div></div>
</div>
.col-fluid div.container
{
padding-top:10px;
}