0

我有一列有一些行。

代码:

<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 作品

有什么问题?margin-top我的尺码有问题吗?

4

1 回答 1

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;
}
于 2013-01-04T21:31:49.043 回答