【发布时间】:2015-01-25 20:33:45
【问题描述】:
我将display: flexbox 用于包含多个正方形的 div 容器(以使它们水平对齐),它在 Chrome 中运行良好,但在 Safari 8.0 中却不行,它被这样删除:
#grid {
overflow-x: hidden;
overflow-y: scroll;
position: absolute;
top: 55px;
left: 415px;
bottom: 10px;
right: 10px;
display: flex;
justify-content: space-between;
flex-direction: row;
flex-wrap: wrap;
}
.square {
width: 166px;
height: 185px;
position: relative;
cursor: pointer;
background-size: 166px 125px !important;
background-repeat: no-repeat !important;
background: #FFF;
margin-right: 20px;
float: left;
}
【问题讨论】:
-
可能你的样式被其他样式覆盖了?
-
我尝试向他们添加 !important,但没有运气。下面唯一的另一个是用户代理样式表。
-
Safari 确实支持 flex 在我看到你的网站之前我感觉不对。
-
这是instadj.com - 视频缩略图网格。
-
使用前缀
display:-webkit-flex;猜测可行
标签: css safari flexbox safari-web-inspector