CSS过渡IE问题

时间:2015-10-16 13:59:14

标签: html css internet-explorer

我正在尝试构建一个简单的css卡翻转样式页面,它适用于除IE 11之外的所有浏览器,我不知道为什么。我假设它与以下代码有关:

/* entire container, keeps perspective */
.flip-container {
    perspective: 1000;
    -moz-perspective: 1000;
    -webkit-perspective: 1000;
}
    /* flip the pane when hovered */
    .flip-container:hover .flipper, .flip-container.hover .flipper {
        transform: rotateY(180deg);
        -ms-transform: rotateY(180deg);
        -webkit-transform: rotateY(180deg);
        -moz-transform: rotateY(180deg);
        -o-transform: rotateY(180deg);

    }

.flip-container, .front, .back {
    width: 300px;
    height: 300px;
}

/* flip speed goes here */
.flipper {
    transition: 0.6s;
    -webkit-transition: 0.6s;
    -moz-transition: 0.6s;
    -o-transition: 0.6s;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    position: relative;
}

/* hide back of pane during swap */
.front, .back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
}

/* front pane, placed above back */
.front {
    z-index: 2;
    /* for firefox 31 */
    transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
    -moz-transform: rotateY(0deg);
    -ms-transform: rotateY(0deg);
    -o-transform: rotateY(0deg);

}

/* back, initially hidden pane */
.back {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
}

这是我的jsfiddle ...在Chrome中测试,看看它是否按预期工作,然后在IE 11中查看它是否破坏。

https://jsfiddle.net/xebcx8gt/2/

1 个答案:

答案 0 :(得分:0)

您必须指定要添加转换的CSS属性。我猜想Chrome是宽容的,并假设你指的是all什么都没有指定。

将您的transition: 0.6s;更改为transition: transform 0.6s;

有关transition属性及其语法的详细信息,请查看MDN's page on it