Safari浏览器中的内联块故障

时间:2018-04-17 14:10:41

标签: html css safari responsive display

我无法弄清楚为什么有些内联块只能在Safari上的宽屏显示器上直线输出。有些上升,有些下降。您可以在此 fiddle 中看到。我已经尝试改变大小,并继续推动一些盒子类向上。任何帮助都会受到关注,谢谢你。

-Xms1024m 
-Xmx4096m # <------ increase this to most of your RAM 
-XX:MaxPermSize=1024m 
-XX:ReservedCodeCacheSize=440m 
-XX:+UseCompressedOops 
-XX:-HeapDumpOnOutOfMemoryError 
-Dfile.encoding=UTF-8
body{
  background-color:grey;
}
.outer {
  text-align:center;
}

.box {
  display: inline-block;
  color: white;
  font-family: 'Courier New';
  background-color: skyblue;
  width: 250px;
  height: 270px;
  margin: 10px;
  -webkit-transition: background-color 2s ease-out;
  -moz-transition: background-color 2s ease-out;
  -o-transition: background-color 2s ease-out;
  transition: background-color 2s ease-out, transform .2s;
}

.box:hover {
  background-color: #4aa8ea;
}

.zoom {
  width: 50%;
  height: 50%;
  transition: transform 2s, filter 2s;
  margin: 10px;
}

.box:hover .zoom {
  -webkit-filter: drop-shadow(5px 5px 5px #222);
  filter: drop-shadow(5px 5px 5px #222);
  -ms-transform: scale(1.1);
  /* IE 9 */
  -webkit-transform: scale(1.1);
  /* Safari 3-8 */
  transform: scale(1.1);
}

.centerImg {
  margin-left: auto;
  margin-right: auto;
}

.ttl {
  background-color: black;
  font-weight: bold;
  font-family:monospace;
  font-size:20px;
}

.desc {
  color: black;
  width: 100%;
  height: 30%;
  box-sizing: border-box;
  word-wrap: break-word;
  font-size:10px;
  padding:10px;
  overflow:hidden;
  background-color:white;
}

.wrapper {
  -webkit-column-width: 150px;
  column-width: 150px;
  height: 100%;
}

更新 事实证明,这只发生在Safari浏览器中。关于如何解决这个问题的任何想法?

1 个答案:

答案 0 :(得分:0)

您需要为所有内联块元素设置vertical-align属性。

.box {
    vertical-align: top;
}