2015-10-04 31 views
3

工作在网格布局,我遇到了与Windows/Mac不同的css滚动条的障碍。铬滚动条行为不同的Mac上与Windows

Mac Version

通知滚动条是在右边,远离实际行。现在在Windows上,我看到

Windows Version

为什么是它的窗户推的div行到下一行?解决这个问题的最好方法是什么?

在HTML一般格式为:

<div class="diamond-stat-body"> 
    <div class="diamond-row"> 
     <div class="diamond-block diamond-stat-block"> 
     </div> 
     <div class="diamond-block diamond-stat-block"> 
     </div> 
     ... 
    </div> 
    .... 
</div> 

和相应的CSS ...

.diamond-stat-block{ 
    width: 125px; 
    height: 2.5em; 
    padding: .5em; 
} 

.diamond-block{ 
    border: .1em solid white; 
    border-radius: 2px; 
    background-color: #ddd; 
    padding: 1em; 
    display: inline-block; 
    float: left; 
} 

.diamond-row{ 
    height: 2.5em; 
} 

.diamond-body{ 
    width: 480px; 
    height: 30%; 
    overflow-y: scroll; 
    margin: 0em auto; 
} 

回答

1

你为什么不使用真正的<table>

如果你不想这样做,那么使用display: table;display: table-cell;怎么办?

我还没有测试过,所以我不知道这是否能解决您的问题。

相关问题