我目前正在使用从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上呢?
您发布的代码是已弃用的弹性框代码。
下面是一个前缀版本,使用 Play 中的自动前缀器last 10 versions
生成:
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,只包括需要前缀的属性。