【问题标题】:chrome scrollbar behavior different on mac vs windowsmac与windows上的chrome滚动条行为不同
【发布时间】:2015-10-04 16:50:23
【问题描述】:

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

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

为什么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;
}

【问题讨论】:

    标签: css google-chrome scrollbar


    【解决方案1】:

    为什么不使用实际的&lt;table&gt;

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-14
      • 2013-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-07
      • 2019-11-14
      • 2014-05-07
      相关资源
      最近更新 更多