/* entire container, keeps perspective */ /** * 【perspective: number|none;】 * 属性定义 3D 元素距视图的距离,以像素计。该属性允许您改变 3D 元素查看 3D 元素的视图。 * 当为元素定义 perspective 属性时,其子元素会获得透视效果,而不是元素本身。 */ .flip-container {perspective: 1000;} /* flip the pane when hovered */ .flip-container:hover .flipper, .flip-container.hover .flipper {transform: rotateY(180deg);} .flip-container, .front, .back {width: 320px;height: 480px;} /* flip speed goes here */ /** * 【transition: property duration timing-function delay;】 * 过渡动画 (transition: width 2s;) * transition-property:规定设置过渡效果的 CSS 属性的名称。(width) * transition-duration:规定完成过渡效果需要多少秒或毫秒。(2s) * transition-timing-function:规定速度效果的速度曲线。(ease-in-out) * transition-delay:延迟时间,以秒或毫秒计。 */ /** * 【transform-style: flat|preserve-3d;】 * 使被转换的子元素保留其 3D 转换 * flat:子元素将不保留其 3D 位置。 * preserve-3d:子元素将保留其 3D 位置。 */ .flipper {transition: 0.6s;transform-style: preserve-3d;position: relative;} /* hide back of pane during swap */ /** * 【backface-visibility: visible|hidden;】 * 定义当元素背面是否可见。 */ .front, .back {backface-visibility: hidden;position: absolute;top: 0;left: 0;} /* front pane, placed above back */ .front {z-index: 2;} /* back, initially hidden pane */ .back {transform: rotateY(180deg);}
查看更多关于CSS图片翻转例子_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did108307