我目前正在使用从 Chrome 设置页面获取的代码,它在 Chrome 上运行良好。
-webkit-box-align: center;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-perspective: 1px;
bottom: 0;
display: -webkit-box;
left: 0;
overflow: auto;
position: fixed;
right: 0;
top: 0;
该代码不适用于 IE 和 Firefox。如何在 IE 和 Firefox 上使用相同的代码?
最佳答案
您发布的代码已弃用 flexbox代码。
这是一个带前缀的版本,使用 最近 10 个版本
和 Play 上的 Autoprefixer 生成:
flex-align: center;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-perspective: 1px;
perspective: 1px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
这不包括您原始帖子中的其他 CSS,仅包括需要添加前缀的属性。
关于CSS如何解决-webkit-函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29610575/