我试图让一个悬挂在CSS中的3d转换功能。我的代码在这里直接从教程中直接复制,因为无论我多么努力,我都无法正常工作。链接到它是如何应该看起来是:http://desandro.github.com/3dtransforms/examples/card-01.htmlCSS 3d透视关闭
,我的代码是:
<html>
<head>
<style media="screen">
.container {
width: 200px;
height: 260px;
position: relative;
-webkit-perspective: 800;
}
#card {
width: 100%;
height: 100%;
position: absolute;
-webkit-transform-style: preserve-3D;
-webkit-transition: -webkit-transform 2s;
}
#card figure {
display: block;
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
}
#card .face1 {
background: red;
}
#card .face2 {
background: blue;
-webkit-transform: rotateY(180deg);
}
#card:hover {
-webkit-transform: rotateY(180deg);
}
</style>
</head>
<body>
<section class="container">
<div id="card">
<figure class="face1">1</figure>
<figure class="face2">2</figure>
</div>
</section>
</body>
</html>
就像我说的它从教程字几乎字,我唯一改变的是使用悬停代替按钮。谢谢你的帮助。
现在完美工作,谢谢。 – jrl589 2012-07-27 22:10:51