Chrome与Windows

时间:2015-10-04 16:50:23

标签: css google-chrome scrollbar

在网格布局上工作,我遇到了一个路障,其中css滚动条在windows / mac之间有所不同。

Mac Version

请注意,滚动条位于右侧并远离实际行。现在在Windows上,我看到了

Windows Version

为什么windows将行中的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 个答案:

答案 0 :(得分:1)

为什么不使用实际的<table>

如果您不想这样做,那么使用display: table;display: table-cell;呢?

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